4 replies [Last post]
scribble
Offline
newbie
Last seen: 16 years 41 weeks ago
Timezone: GMT-5
Joined: 2004-02-12
Posts: 5
Points: 0

I can't be the only person having this problem, yet it seems impossible to get any answer.

I want to be able to create two different link colors for a page via css. Everything I've tried has failed. I normally use white background space for copy areas and a colored area for navigation. White provides the highest contrast for the navigation since it usually has a dark colored background. However, I can't use white as the link color for any links which reside in the copy area since the background is white.

Is it possible to create two different link colors for a page without embedding font color right before the word that's a link. Is it possible to use CSS to create two different link colors?

Please don't use too much 'geek speak' as I'm not a code guru.

Thank you for your time,
Scribble :?

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 2 years 3 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Multiple Link Colors

Hi

Let's say your links are like this:

Link 1 in Body area:

<a href="url1">link 1</a>

and the other Link 2 is in the navbar:

<a href="url2">link 2</a>

Assuming you want to leave link 1 as is, add this code to your head:

<style type="text/css">
a .navlink {
color: white;
}

and change the link to:

<a class="navlink" href="url2">link 2</a>

Should do it.

Trevor

scribble
Offline
newbie
Last seen: 16 years 41 weeks ago
Timezone: GMT-5
Joined: 2004-02-12
Posts: 5
Points: 0

Didn't Work...

This only works if you're using 1 style sheet. I need to use two. One for the navigation and one for copy. If I add a second style sheet the a: link attribute over rides the first style attribute and if I link it to an external style sheet the same thing happens.

Any other solutions?

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 2 years 3 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Multiple Link Colors

Hi

I need to look at the code to get a handle on this. Do you have a url and linkls for the style sheets (easier to download into my editor, than searching the cache for them).

Trevor

scribble
Offline
newbie
Last seen: 16 years 41 weeks ago
Timezone: GMT-5
Joined: 2004-02-12
Posts: 5
Points: 0

http://www.scribblegraphics.com/clnason/comp1.html

Trevor,

Here's the url. I'm running out the door as I post this so I don't have the latest attempts at the css but you'll get an idea of what I'm trying to occomplish. The links in the navigation on the right I would like to be white and turn red as users hover over them. The link in the copy of the page which you can't see because its white I would like bold and grey and blue as you hover.

I just need to see the proper code in place in order to understand this. If you feel as though you can or any one else reading this can provide the answer I would be very greatful.

Here's the url http://www.scribblegraphics.com/clnason/comp1.html