I'm trying to use different colors in the same HTML link. It seems to work at first, but when I hover over the link with the mouse, the underline is drawn with only a single color.
I'm using this HTML as CSS:
body {
background: #E7CEAF;
}
a {
color: white;
background: darkred;
text-decoration: none;
}
a:hover {
color: powderblue;
text-decoration: underline;
}
.tag {
font-style: italic;
color: yellow;
}
a:hover .tag {
text-decoration: none !important;
/* doesn't work */
}
This is some text: <a href="https://www.example.com"><span class="tag">[this is a tag] </span>This is a link, the tag being part of the link</a>
You can play with it on JSFiddle.
As you can see there, the underline is blue, even under the yellow words. How can I style the hovering links to display a yellow underline (or even no line) under the yellow part?