I'm trying to add a clickable card with an image and text below in a Docebo page. Tried it in editor and browser it worked fine. Here is the code:
/////////
<style>
.tcolumn {
float: left;
width: 18.68%;
margin-bottom: 16px;
padding: 0 8px;
}
@media screen and (max-width: 650px) {
.tcolumn {
width: 100%;
display: block;
}
}
.tcard {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
border: 2px solid #1e5b67;
}
.tcontainer {
padding: 0 16px;
text-align: center;
background: #ffffff;
margin-top: -25px;
}
.tcontainer::after, .row::after {
content: "";
clear: both;
display: table;
}
</style>
<div class="row">
<a style="display: inline-block;" href="https://picsum.photos/images">
<div class="tcolumn">
<div class="tcard">
<img src="https://picsum.photos/id/1/222/148"/>
<div class="tcontainer">
<div style="padding-top:30px;height:175px;font-family:Arial;">
<p style="font-size:15px;font-weight:600;color:#1e5b67;margin-top:33%;">Content 1</p>
</div>
</div>
</div>
</div>
</a>
<a style="display: inline-block;" href="https://picsum.photos/images">
<div class="tcolumn">
<div class="tcard">
<img src="https://picsum.photos/id/1/222/148"/>
<div class="tcontainer">
<div style="padding-top:30px;height:175px;font-family:Arial;">
<p style="font-size:15px;font-weight:600;color:#1e5b67;margin-top:33%;">Content 2</p>
</div>
</div>
</div>
</div>
</a>
</div>
///////////
But when I added this code to the HTML widget on the Docebo page, it didn't work. When I save this code in a Docebo HTML widget, I see that the <a> tag is automatically applied to each div element instead of just the parent div element, resulting in the entire card not working as clickable.
After saving the above code in the HTML widget, it became like this:
<div class="row">
<a style="display:inline-block;" href="https://picsum.photos/images"></a><div class="tcolumn"><a style="display:inline-block;" href="https://picsum.photos/images">
</a><div class="tcard"><a style="display:inline-block;" href="https://picsum.photos/images"><img src="https://picsum.photos/id/1/222/148" alt="148" /></a><div class="tcontainer"><a style="display:inline-block;" href="https://picsum.photos/images">
</a><div style="padding-top:30px;height:175px;font-family:Arial;"><a style="display:inline-block;" href="https://picsum.photos/images">
</a><p style="font-size:15px;font-weight:600;color:#1e5b67;margin-top:33%;"><a style="display:inline-block;" href="https://picsum.photos/images">Content 1</a></p><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images"></a>
<a style="display:inline-block;" href="https://picsum.photos/images">
</a><div class="tcolumn"><a style="display:inline-block;" href="https://picsum.photos/images">
</a><div class="tcard"><a style="display:inline-block;" href="https://picsum.photos/images"><img src="https://picsum.photos/id/1/222/148" alt="148" /></a><div class="tcontainer"><a style="display:inline-block;" href="https://picsum.photos/images">
</a><div style="padding-top:30px;height:175px;font-family:Arial;"><a style="display:inline-block;" href="https://picsum.photos/images">
</a><p style="font-size:15px;font-weight:600;color:#1e5b67;margin-top:33%;"><a style="display:inline-block;" href="https://picsum.photos/images">Content 2</a></p><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images">
</a></div><a style="display:inline-block;" href="https://picsum.photos/images"></a>
</div>
Has anyone encountered this issue/does anyone know how to fix it?
Thanks for your help in advance.