Forum Moderators: not2easy

Message Too Old, No Replies

Simple CSS Question, I think...

Changing the "a" element within a class

         

jimh009

7:18 am on Dec 19, 2004 (gmt 0)

10+ Year Member



Hello,

I'm relatively new to CSS but am learning fairly quickly. Unfortunately, I'm stumped by what is probably a darn easy thing to do. Was hoping someone might be so kind to help me out.

I need to change the "a" element within a class. Basically, I need to change the color, decoration, hover and visited colors of all "a" elements within my top navigation bar. The rest of the "a" elements on the page will be your typical blue links, red hover and purple visit. However, for the top navigation bar, I have a dark green background and need the anchor element to be pure white, with no link underlining, no visited link coloring and with a hover color as yet to be determined.

The class that the navigation bar is in is titled .topnavbar, and sets the font color to white, the background color to dark green and the text to Arial with a size of 14. For the life of me, though, I've yet to figure out how to set the "a" element within this particular class. I know how to set it for the entire page - just not this particular class/element.

Anyone care to shed some insights?

Also, will having white text within a dark background that is all set up with CSS cause problems with Google and the other SE's as far as "hidden text" goes. Or are the SE's smart enough to figure out that the color of the text (white) is plainly visible against the dark green background - even though it is all set up with CSS?

Thanks.

Jim

BonRouge

7:27 am on Dec 19, 2004 (gmt 0)

10+ Year Member



.topnavbar a {text-decoration:none;}
.topnavbar a:link, .topnavbar a:visited {color:white;}
.topnavbar a:hover {color:...?}

kaled

11:56 am on Dec 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There have been reports of Google reading external style sheets but this does not seem to be routine practice. Provided the text is visible when no style sheet is available, there should not be a problem.

Kaled.

BonRouge

5:35 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



As far as 'hidden' text goes. Your text is not hidden from Google or whoever. It's right there on the page. Google can tell the difference between white text and a white background - it's pretty smart.

theguX

5:38 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Does that mean that if I had white text on a white background, it would be hidden from google?

BonRouge

5:49 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



NO! Just the opposite. Text is text whatever colour it is. Think about it for a second - Google doesn't have or need eyes - the colour something is really doesn't matter.

theguX

7:06 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



That's what I thought... I misunderstood what was said.