微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – CSS属性以插入符号开头

我目前正在维护的项目中的许多CSS属性都以插入符号开头,如下所示:
<tr style="^padding-bottom: 10px;">

插入符号有什么意义吗?也许修复了一些不起眼的浏览器?或者它只是来自以前的开发人员的一个错误,已被复制粘贴x次(因为它总是与’padding-bottom’一起)?

解决方法

它们前面带有插入符号的样式不适用.因此,在这种情况下,它可能是一种注释掉CSS样式的方法,而不必使用整个HTML注释.但这不是一种标准的方法.

(Example)

CSS中的插入符号确实有意义,即“开始于”Attribute selector.

它允许您根据属性的值是否以给定字符串开头来定位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"

但是,在您的情况下,插入符号不能用作选择器.

原文地址:https://www.jb51.cc/html/223933.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐