PDA

View Full Version : Highlight link when page is showing


lux
09-18-2006, 07:26 PM
Sorry if i dont explain this clearly but im not sure how best to describe my query.

I would like to find out how, using css, to make the color of a link different based on the fact that the user is currently viewing that page.

e.g. A visitor enters the url of the website, when their request is met the page is displayed and the home link is coloured say black as apposed to red which all the other page links are coloured based on the fact that they are viewing the home page.

Hope that makes sense and someone has an answer.

Thanks people.

lux
09-18-2006, 07:57 PM
found my solution here:

http://www.hicksdesign.co.uk/journal/highlighting-current-page-with-css

hope it helps if anyone needs it!

Creative Insanity
09-18-2006, 08:23 PM
that'll be a:focus.

fwr1000
09-19-2006, 12:15 PM
CI, is a:focus supported in all/most/some browsers?

domedia
09-19-2006, 12:59 PM
:focus is used on elements that has 'focus, for example in a textarea when the user is typing in text.
CSS itself does not have something to detect which page you're on and apply, except for the hardcoded solution in the link above to hicksdesign.