View Full Version : CSS and Links

01-21-2005, 02:12 AM

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?

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}


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

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

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


Hope it helps...

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}

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


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum