What is the CSS code that I need to write in order to remove the underline from these link after visiting them?
<ul id = "header">
<li><a href="sigur ros.html"> Home </a> </li>
<li>Images</li>
<li>Videos</li>
</ul>
I tried this:
a:visited { text-decoration: none; }
but it didn't work.
Here is a fiddle showing the problem: http://jsfiddle.net/litari/X2Yjk/1/
To remove underline from a link in HTML, use the CSS property text-decoration. Use it with the style attribute. The style attribute specifies an inline style for an element. Use the style attribute with the CSS property text-decoration to remove underline from a link in HTML.
What to Know. Remove the underline on text links with the CSS property text-decoration by typing a { text-decoration: none; }. Change the underline to dots with the border-bottom style property a { text-decoration: none; border-bottom:1px dotted; }.
Click the small button at the bottom-right corner of the Styles section in the ribbon. Click the arrow to the right of Hyperlink in the Styles pop-up menu, then click the Modify option. Click the Underline button in the Formatting section of the window, then click the OK button to apply the change.
You can't change text-decoration in :visited
Rather set text-decoration:none on anchors and text-decoration:underline on links you want underlined. For example you can use a class to achieve this.
a
{
text-decoration:none;
}
a.underlined
{
text-decoration:underline;
}
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