There is a link on page 1 that takes you to a specific point on page 2
<a href="page2.html#position">MY TEXT HERE</a>
This will lead you directly to the anchor (position) on page 2 with the following code
<a name="position"> MORE TEXT HERE</a>
Now, my question is: how do I change the color of text and background when #position is in the URL?
For example: www.domainname.com/page2.html#position
This is the CSS that I used but does not work:
#position {
color:#ff0000;
background-color:#f5f36e;
}
Here is an example http://jsfiddle.net/jvtcj/2/
Thank you in advance!
source
share