I want to use a link pointing to a anchor in the same dokument to control the visibility of div’s inside a dokument. Why do I want to do this? I want to be able to show different contents through the url. Is this possible through css?
Example:
index.html#test
<div id="test">This is visible</div>
<div id="not">This is not visible</div>
<div id="may">May be visible through a css selector</div>
Use the
:targetselector. It’s relatively new (CSS3), so doesn’t work in all browsers.