小白教程
所有教程
关于
Search
172.71.254.250
172.71.254.250
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Sel target”的源代码
本页内容
上一节:
Sel_empty
下一节:
Sel_enabled
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE::target}}[[Category:css selectors|39]] = CSS3 :target 选择器 = [[css selectors|完整CSS选择器参考手册]] Highlight active HTML anchor: <sample title="" desc="" lang="html" hererun="1"> :target { border: 2px solid #D4D4D4; background-color: #e5eecc; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> :target { border: 2px solid #D4D4D4; background-color: #e5eecc; } </style> </head> <body> <h1>This is a heading</h1> <p><a href="#news1">Jump to New content 1</a></p> <p><a href="#news2">Jump to New content 2</a></p> <p>Click on the links above and the :target selector highlight the current active HTML anchor.</p> <p id="news1"><b>New content 1...</b></p> <p id="news2"><b>New content 2...</b></p> <p><b>注意:</b> IE 8 以及更早版本的浏览器不支持 :target 选择器.</p> </body> </html> </run> == 定义和用法 == # 锚的名称是在一个文件中链接到某个元素的URL。元素被链接到目标元素。 :target选择器可用于当前活动的target元素的样式。 == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 选择器 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | :target | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |} [[css selectors|完整CSS选择器参考手册]]
返回至“
Sel target
”。
上一节:
Sel_empty
下一节:
Sel_enabled