CSS Links help

Joined
Dec 11, 2001
Messages
961
Hey all,

Im working on a new design for a site, www.sitonthefloor.com. still a work in progress. and my first major dabble with CSS.

My main problem is with doing links and CSS. The navigation links are a perfect yellow colour. however i want links in the main section to be diffrent.

Since i have used the A:Link attributes im not sure how to work this.

anyone got any tips?

thanks
 
my suggestion to you would be switch the links for the whole site to be what you want them to be in the main body, then define a special class for the links in the nav. in other words, change the link color that is yellow now to something else (whatever you want the color to be for the links in the main body), and then make a new class. something like this:

Code:
a:link {
  background-color: grey;
  color: black;
}

a.navigation:link {
  background-color: black;
  color: yellow;
}

then your html for the navigation would be
Code:
<a class="navigation" href="about.html">about</a>
 
Another way (same concept, but might be easier to implement depending).

Code:
a:link {
  color: black;
}

.navigation a:link {
  color: yellow;
}

<body>
  <div class="navigation">
    <a href="#">all my links in this div are yellow</a>
  </div>

  <a href="#">This link should be black</a>
</body>


--KK
 
You could also
Code:
:link {
  color: black;
}

.navigation :link {
  color: yellow;
}
...and so forth. AFAIK, useless for :link, but has potential for :hover and other tag-generic pseudoclasses. It probably applies to SVG if you are (for whatever reason) sharing a CSS file with that format.
 
Back
Top