Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the underline from under a visited link [duplicate]

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/

like image 485
joe11093 Avatar asked Jul 24 '14 13:07

joe11093


People also ask

How do I remove the underline from a link?

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.

How do you change the underline on a link?

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; }.

How do I remove the underline from a hyperlink in Word?

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.


1 Answers

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;
}
like image 196
dk_french032 Avatar answered Oct 25 '22 11:10

dk_french032