Lacer
Lacer

Reputation: 5958

css - change color of link in css

i have http://jsfiddle.net/bgw34wqn/. I'm trying to figure out how can i change the font color of Menu3 to red.

<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Untitled</title>
</head>
<body>
<div id="navL4test">
    <ul class="navL4test">
      <li><a href="http://www.cnn.com">Menu1</a></li>
      <li><a href="http://www.cnn.com">Menu2</a></li>
      <li class="navL4test-select"><a href="http://www.cnn.com">Menu3</a></li>
    </ul>
</div>
</body>
</html>

Upvotes: 0

Views: 52

Answers (2)

Sam
Sam

Reputation: 185

you have css specificity issues here, based on the jsfiddle. also, when you write css rules and have commas, you have to also keep carrying the class names. such as:

.foo a:link, .foo a:active { ... }

you can change the jsfilddle rule to this (remove the :link part):

.navL4test-select a, .navL4test-select a:active {color: red;}

Upvotes: 1

ceejayoz
ceejayoz

Reputation: 179994

Looks like you already have...

enter image description here

with this code:

.navL4test-select a:link, a:active {color: red;}

Upvotes: 0

Related Questions