<style>
div [data-endpoint="/one/two/three/"] {display:none}
</style>
<div data-endpoint="/one/two/three/">
example text
</div>
Run Code Online (Sandbox Code Playgroud)
这里的实时代码示例:http://jsfiddle.net/DDUNp/2/
因为div
和data-endpoint
属性之间的空格显式指定具有该属性的元素是div
; 的后代元素; 删除空间,它的工作原理:
div[data-endpoint="/one/two/three/"] {display:none}
Run Code Online (Sandbox Code Playgroud)
参考文献: