Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS style for links pointing to the current page?

I was wondering if there is any way in CSS3 to style links pointing to the same page that are already displayed in the browser—for example to highlight it red in the navigation telling the user "You are here right now!" since I have few lists with links, and I expect some users will probably read them one-by-one.

So if the browser is at /features/feature3.php, then obviously I would like to change the appearance of all links with the same href destination.

It seems like there is only :hover, :focus, and :active, but nothing to solve this problem purely in CSS. Am I missing something?

like image 799
iHaveacomputer Avatar asked Jan 25 '12 06:01

iHaveacomputer


1 Answers

you can use CSS3 attribute selectors for this.

a[href='your url'] { *** }
like image 145
Chamika Sandamal Avatar answered Oct 02 '22 01:10

Chamika Sandamal