...

View Full Version : CSS and Links



seanohio
01-21-2005, 02:12 AM
Greetings,

I have a problem with links.

I have a coloured bar on the top of my page. Below the bar is a white background. I need two sets of links colours, with hover effect and no underline, so that they'll show up okay in each section. How can I make two sets like this?

Jalenack
01-21-2005, 02:19 AM
hey...there's an easy solution for this.

for the links in your navigation bar
- assign the <div> or <td> (or whatever) that all your links are contained in an id, such as "navbar"
- add this CSS:

#navbar a { color: blue; text-decoration: none}

etc...

This tells all links inside the container "navbar" to behave a certain way. The other links in your page will not be affected, so style them the same way you did before

seanohio
01-21-2005, 02:46 AM
Thanks--that works okay--but how do I add a hover effect?

rmedek
01-21-2005, 03:05 AM
Use the :hover psuedo-class. "What's that?" you say?

http://www.w3schools.com/css/css_pseudo_classes.asp

Hope it helps...

seanohio
01-21-2005, 03:11 AM
Right, I've put that in, but nothing happens. Here's what I have:

.navbar a:link { color:e8e8e8; text-decoration: none}
a:visited {color: #00FF00}
a:hover {color: #FF00FF}
a:active {color: #0000FF}

seanohio
01-21-2005, 03:24 AM
.navbar has to be before everything

Thanks!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum