View Full Version : Multiple A: colors


evalopez
01-02-2006, 03:54 AM
so I've been thinking of slightly tweaking the colors at my site, and keep hitting a snag. Is it possible to have more than one a: tag in a stylesheet without overruling the one at the bottom? My goal is to have the text in the body and the right nav a different color than the left nav links.

http://www.sol-martin.com/news.htm
gives an example of what it looks like now.

my stylesheet is:
http://www.sol-martin.com/style1.css


Hope someone can help and not say I have to use two stylesheets (although I'm not ruling it out... although how would it work anyway??)!

Sol

djou
01-02-2006, 04:37 AM
You will need to use CSS id's. Your left nav already is <p id="leftnav">. Where you have:

<td width="492"><!-- InstanceBeginEditable name="body" -->
<h2>Welcome To Sol-Martin.com!</h2>

add id="body" to the td. You already have id="right".

In your CSS, put:

#leftnav a:link {properties and values}
#leftnav a:visited {properties and values}
#leftnav a:hover {properties and values}
#leftnav a:active {properties and values}

and

#body, #right a:link {properties and values}
(etc.)

As for your question concerning two stylesheets, it can be done on one page by having, for example, <link rel="stylesheet" href="style1.css" type="text/css"> and <link rel="stylesheet" href="style2.css" type="text/css">. It can be useful when one of your pages needs much more CSS and you don't want it to have to load on all pages. It would however be unnecessary in this case.