我目前正在维护的项目中的许多CSS属性都是以^这样的插入符号开头的:
<tr style="^padding-bottom: 10px;">
Run Code Online (Sandbox Code Playgroud)
插入符号有什么意义吗?也许修复了一些不起眼的浏览器?或者它只是来自以前的开发人员的一个错误,已被复制粘贴x次(因为它总是与'padding-bottom'一起)?
它们前面带有插入符号的样式不适用.因此,在这种情况下,它可能是一种注释掉 CSS样式的方法,而不必使用整个HTML注释.但这不是一种标准的方法.
CSS中的插入符号确实有意义,即"开始于" 属性选择器.
它允许您根据属性的值是否以给定字符串开头来定位CSS中的元素.
E[foo] an E element with a "foo" attribute
E[foo="bar"] an E element whose "foo" attribute value is exactly equal to "bar"
E[foo~="bar"] an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar"
E[foo^="bar"] an E element whose "foo" attribute value begins exactly with the string "bar"
E[foo$="bar"] an E element whose "foo" attribute value ends exactly with the string "bar"
E[foo*="bar"] an E element whose "foo" attribute value contains the substring "bar"
Run Code Online (Sandbox Code Playgroud)
但是,在您的情况下,插入符号不能用作选择器.
| 归档时间: |
|
| 查看次数: |
1916 次 |
| 最近记录: |