您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

CSS 的作用:目标选择器

2024/3/15 16:09:03发布13次查看
使用 css :target 选择器通过 css 突出显示活动的 html 锚点。
示例您可以尝试运行以下代码来实现 :target 选择器
现场演示
<!doctype html><html> <head> <style> :target { border: 2px solid #d4d4d4; background-color: orange; color: white; } </style> </head> <body> <p>click any of the subject below.</p> <p><a href = "#tut1">maths</a></p> <p><a href = "#tut2">java</a></p> <p><a href = "#tut3">c++</a></p> <p><a href = "#tut4">c</a></p> <p>this is demo text.</p> <p>this is demo text.</p> <p>this is demo text.</p> <p>this is demo text.</p> <p>this is demo text.</p> <p id = "tut1"><b>maths tutorial</b></p> <p id = "tut2"><b>java tutorial</b></p> <p id = "tut3"><b>c++ tutorial</b></p> <p id = "tut4"><b>c tutorial</b></p> </body></html>
以上就是css 的作用:目标选择器的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product