How can I change the color of the underline only, when the use mouse hovers a string?
Here is the site, in the right corner u will see the menu.
How can I change the color of the underline only, when the use mouse hovers a string?
Here is the site, in the right corner u will see the menu.
text-decoration-color is only supported by Mozilla.
What I would suggest is use
1) border-bottom
a:hover
{
text-decoration: none;
border-bottom: 1px solid blue;
}
OR
2) background image in CSS.
a:hover
{
text-decoration: none;
background: url('image.jpg') #FFF repeat-x;
}
Make the image suiting your need. And position the background image to bottom. And rest of the color can #FFF.
You can use three methods:
Using text-decoration-color
.
a:hover {text-decoration-color: green; color: blue;}
Using two DOM elements!
a:hover {color: green; text-decoration: underline;}
a:hover span {color: blue;}
Using a border-bottom
:
a:hover {border-bottom: 1px solid green; color: blue;}
All the three methods give the same output. Colour with a blue and line with a green!
Also, along with the above methods, there are a lot: Crafting link underlines. Thanks to srekoble.
Try this
<style type="text/css" media="screen" />
a {
text-decoration: none;
}
a:link {
color: #0000FF;
border-bottom: 1px solid #0000FF;
}
a:visited {
color: #0000FF;
border-bottom: 1px solid #C0C0C0;
}
a:active {
color: #FF0000;
border-bottom: 1px solid #FF0000;
}
a:hover {
color: #000000;
border-bottom: 2px solid #DD0000;
}
</style>
<a href="http://www.google.com/">Hover this link to view the color change</a>
you can change it simply by adding
a:hover{
text-decoration:underline;
border-bottom: 0px solid blue;
}