Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
162
rated 0 times [  166] [ 4]  / answers: 1 / hits: 24955  / 12 Years ago, thu, june 21, 2012, 12:00:00

What I am attempting to do is to highlight a div with a certain id, when It has been referred to by an anchor on another page IE:



User clicks link href=qw.html#test, when the page is loaded, then the div with the id=test
is highlighted so that the user can see it clearly.



I'm sure that I've seen a CSS3 example where a div is highlighted if it was linked to.
Or was it JavaScript?


More From » css

 Answers
10

You need to use the :target pseudo-class:



:target {
background-color: #ffa;
}


JS Fiddle demo.


[#84749] Wednesday, June 20, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leandraannabellar

Total Points: 255
Total Questions: 89
Total Answers: 89

Location: England
Member since Sun, May 21, 2023
1 Year ago
;