anvd
anvd

Reputation: 4047

links in html - colours

i have this in my code

a:link {text-decoration: none; color: black;}
a:visited {text-decoration: none; color: black}
a:active {text-decoration: none; color: black}
a:hover {text-decoration: underline; color: grey;}

but now i need which in the same page, but in another local, the colors change to another

for exemple in the header the link colors are white and in the button are black.

I can't simple repeat the code above.

How can i solve that?

Upvotes: 0

Views: 95

Answers (2)

user428071
user428071

Reputation:

If your after variables and constants in css you could always try lesscss or SASS if your using Rails.

Upvotes: 1

JEEND0
JEEND0

Reputation: 482

You could assign a class to the header links:

<a class="header" href="yourpage.html">Header Link</a>

and then in your CSS:

a.header:link {text-decoration: none; color: black;}
a.header:visited {text-decoration: none; color: black}
a.header:active {text-decoration: none; color: black}
a.header:hover {text-decoration: underline; color: grey;}

and for the non header links:

<a href="link.html">Normal Link</a>

and then for the normal links in your CSS:

a:link {text-decoration: brown; color: black;}
a:visited {text-decoration: none; color: black}
a:active {text-decoration: none; color: black}
a:hover {text-decoration: underline; color: grey;}

Upvotes: 2

Related Questions