开发者

Is it possible to control visibility of a div through anchor object with css?

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 :target selector. It's relatively new (CSS3), so doesn't work in all browsers.


This isn't possible with just CSS. You would need to use JavaScript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜