0
<span>Teaching kids to reach their creative and intellectual potentials through Computer Science.</span>

Above is my HTML and below is my CSS:

span { text-decoration: underline; color: red }

If text-decoration is considered part of the foreground, than how can the text-decoration-color property change the text-decoration color without changing the color of the font?

Kevin Behan
  • 486
  • 5
  • 20
  • Very rude, I actually just read the documentation (foreign words and non-explicit annotations). – Kevin Behan Nov 01 '16 at 22:50
  • Which documentation? I recommend reading HTMLDog - http://www.htmldog.com/references/ - it's mainly for HTML 4 Strict, but can be used for HTML5 as well. – junkfoodjunkie Nov 01 '16 at 22:53

3 Answers3

0

Use -webkit-text-decoration-color to change it on Chrome. However, note that Experimental Web Platform Features has to be enabled for it to work. So for now, Chrome just simply does not support this css property.

Sub 6 Resources
  • 1,674
  • 15
  • 31
0

You can't use text-decoration-color cross browsers. See text-decoration-color support browsers. If you really needed to change the underline color maybe this link can help you. CSS text-decoration underline color

Community
  • 1
  • 1
Rohman HM
  • 2,539
  • 3
  • 25
  • 40
0

This can be achieved, however, it requires your text to be wrapped in a <span> tag.

Instead of using the <u> tag use text-decoration with underline as a value.

Code Snippet:

p {
  color: red;
  text-decoration: underline;
}
span {
  color: gray;
}
<p><span>Teaching kids to reach their creative and intellectual potentials through Computer Science.</span>
</p>
Ricky Ruiz
  • 25,455
  • 6
  • 44
  • 53