Michael Sórm
Michael Sórm

Reputation: 565

Why doesn't changing the color of link work?

I have stated the .topics:link in CSS but the color is still blue.

HTML is -

<ul class="topics">
     <li><a href="#">United States</a></li>
</ul>

CSS is -

.topics:link {
color: #666665;
}

Upvotes: 0

Views: 3430

Answers (3)

Hemant_Negi
Hemant_Negi

Reputation: 2078

if you only want to change the color of text in <a> tag then use this

.topics a { color: #666665;}

The :link selector is used to select unvisited links.

like

a:link { background-color:yellow; }

these are some pseudo class of a tag

a:link    {color:green;}
a:visited {color:green;}
a:hover   {color:red;}
a:active  {color:yellow;}

Upvotes: 0

MarcinJuraszek
MarcinJuraszek

Reputation: 125620

You're using :link wrong. Use .topics a instead:

.topics a {
    color: #666665;
}

Upvotes: 3

majorhavoc
majorhavoc

Reputation: 2415

.topics a{ color:#666665; } Use this

Upvotes: 1

Related Questions