I have this code here:
echo "<u><font color='red'><br>$username</font></u>";
Firstly, as you can see, it's underlined (< u >). Second, all text is all red. Well is there anyway to leave the text ($username) red but the underline black?
Underline tag: To change the color of the underline, we need to add some styling using CSS (inline/internal/external). By default, the color of the underline is black. In CSS, we will use text-decoration property to style underline.
Click on the Modify button. There will be a Format dropdown menu at the bottom left; click it to unfold and choose Font. Change Underline color to Automatic (this will make underlines match the color of the font)
Tap Annotate on the toolbar. Select the Highlight , Underline , or Strikeout tool. You can select the color for each tool by tapping the color picker .
There's now a new css3 property for this: text-decoration-color
So you can now have text in one color and a text-decoration underline - in a different color... without needing an extra 'wrap' element
p { text-decoration: underline; -webkit-text-decoration-color: red; /* safari still uses vendor prefix */ text-decoration-color: red; }
<p>black text with red underline in one element - no wrapper elements here!</p>
NB:
1) Browser Support is limited at the moment to Firefox and Chrome (fully supported as of V57) and Safari
2) You could also use the text-decoration shorthand property which looks like this:
<text-decoration-line> || <text-decoration-style> || <text-decoration-color>
...so using the text-decoration
shorthand - the example above would simply be:
p { text-decoration: underline red; }
p { text-decoration: underline red; }
<p>black text with red underline in one element - no wrapper elements here!</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With