Recently I answered a question and the OP wanted text-decoration: underline;
for the entire text wrapped inside the a
element, but not the one wrapped inside span
, so it was something like this
<a href="#"><span>Not Underline</span>Should Be Underlined</a>
So simply giving
span {
text-decoration: none;
}
doesn't remove the underline for the text wrapped inside a span
element
But this does remove the underline
span {
text-decoration: none;
display: inline-block;
}
So I made the span
an inline-block
and it worked, which is how I usually do it. But when it came to explanation I was not able to explain why doing this actually removes the underline where simply using text-decoration: none;
doesn't.
display: block;
wont remove the underline right? – Eustache