Possible Duplicate:
Changing Underline color
It's possible to change only line color which is under text? I would like to see something like red letters with a blue line below it, but I can't find out how to get this done.
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.
The text-decoration-color property sets the color of the underline, overline, or line-through on text with the text-decoration property applied. It can also set the underline color on links.
Steps: Create background image with linear-gradient() . Adjust its size with css background-size property. Place it at the bottom left position of the element with background-position css property.
You can do it if you wrap your text into a span like:
a { color: red; text-decoration: underline; } span { color: blue; text-decoration: none; }
<a href="#"> <span>Text</span> </a>
(for fellow googlers, copied from duplicate question) This answer is outdated since text-decoration-color is now supported by most modern browsers.
You can do this via the following CSS rule as an example:
text-decoration-color:green
If this rule isn't supported by an older browser, you can use the following solution:
Setting your word with a border-bottom:
a:link { color: red; text-decoration: none; border-bottom: 1px solid blue; } a:hover { border-bottom-color: green; }
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