我没看明白这段代码是什么意思?
a[href*=#]:not([href=#])
谢谢!
最佳答案
简单地:
a[href*=#]
获取 href 中包含 #
的所有 anchor (a
)。
但是有:
:not([href=#])
排除 href 完全等于 #
的 anchor 。
例子:
<a href="#step1">yes</a>
<a href="page.php#step2">yes</a>
<a href="#">no</a>
选择器获取前两个 anchor ,但排除最后一个。
更多详情可以咨询attribute selectors chapter
关于html - "a[href*=#]:not([href=#])"代码是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20947529/