Why doesn't the text-decoration on a link include the child element (span
), causing the underline to not extend properly?
https://i.sstatic.net/A3Yth.png
a {
font-size: 36px;
text-decoration: underline dotted rgb(221, 221, 221);
color: #000;
}
a:hover {
text-decoration: none;
color: #000;
}
.badge-dark {
font-size: 9px;
margin-left: 2px;
position: relative;
text-align: center;
top: -5px;
}
<a href="#">
My title is here
<span class="badge badge-dark">Special</span>
</a>
Is there a way for the span
to be included in the styling or does text-decoration
intentionally ignore spans?