I want to remove the underline from the <span>
tag inside the <p>
tag, which has the display: flex;
property.
The <p>
tag in my case has to be flex.
I already searched this problem on the internet and found solutions that do not apply to a flex parent.
They said that adding text-decoration: none;
and display: inline-block;
to the span should fix the problem, but it does not.
<p style="display: flex; gap: 10px; text-decoration: underline;">
This should have underline
<span style="text-decoration: none; display: inline-block;">This should not have underline</span>
</p>
2
Answers
You need to wrap your
span
withdisplay: inline-block;
like this.Remove
display:flex;
on<p>
should work.