Forum Moderators: not2easy

Message Too Old, No Replies

Active when linked

         

sincejan63

3:40 pm on Jun 19, 2007 (gmt 0)

10+ Year Member



Hello everyone I am having an issue that I’ll like some help on. Okay what I basically want is help on the CSS so when I click on a link, in it’s active or visited the image to have a different color border. I am currently using this and the only part that works is the hover which turns the border red. I would appreciate your help
#bwi:hover {
border: 1px solid #FF0000;
}

#bwi:link {
border: 1px solid #00CC00;
}

#bwi:active{
border: 1px solid #00CC00;
display: block;
}
#bwi:visited {
border: 1px solid #00CC00;
display: block;
}

Milamber

3:49 pm on Jun 19, 2007 (gmt 0)

10+ Year Member



you're missing 'a'

#bwi a:hover {
border: 1px solid #FF0000;
}

#bwi a {
border: 1px solid #00CC00;
}

#bwi a:active{
border: 1px solid #00CC00;
display: block;
}
#bwi a:visited {
border: 1px solid #00CC00;
display: block;
}

Fotiman

4:40 pm on Jun 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The ordering of the link states is important. It should be defined in this order in your CSS:

:link
:visited
:hover
:active

Xapti

6:54 pm on Jun 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes the order is important. Also, other than the red hover, the rest of the colors are the same... I'm nots ure if that's what you want or not.

And don't go "#bwi a:hover" unless #bwi is your container for your links, since that code means "style any hovered anchor which is a descendant of #bwi", nothing about just styling #bwi.

If #bwi is just 1 link, then what you had already was fine. (just fix the order)
If #bwi is used for multiple links, you have a problem.
ids (prefix #) are used for SINGLE elements only. You should never have more than 1 element with the same id per page.