What does quot;iquot; mean in a CSS attribute selector?(“我是什么意思?在 CSS 属性选择器中是什么意思?)
问题描述
我在 Google Chrome 用户代理样式表中找到了以下 CSS 选择器:
I have found the following CSS selector in the Google Chrome user agent stylesheet:
[type="checkbox" i]
i
是什么意思?
推荐答案
在评论中提到,它是用于不区分大小写的属性匹配.这是 CSS 选择器级别 4 中的新功能.
As mentioned in the comments, it is for case-insensitive attribute matching. This is a new feature in CSS Selectors Level 4.
目前它在 Chrome 49+、Firefox 47+、Safari 9+ 和 Opera 37+* 中可用.在此之前,它仅在 Chrome 39 前后的 Chrome 用户代理样式中可用,但可以通过设置实验功能标志来启用 Web 内容.
Presently it is available in Chrome 49+, Firefox 47+, Safari 9+, and Opera 37+*. Prior to this it was only available in the Chrome user-agent styles starting around Chrome 39, but could be enabled for web content by setting the experimental features flag.
* Opera 的早期版本也可能支持它.
* Earlier versions of Opera may also support it.
[data-test] {
width: 100px;
height: 100px;
margin: 4px;
}
[data-test="A"] {
background: red;
}
[data-test="a" i] {
background: green;
}
Green if supported, red if not:
<div data-test="A"></div>
如果浏览器支持此功能,上面的方块将是绿色的,如果不支持,则为红色.
The above square will be green if the browser supports this feature, red if it does not.
这篇关于“我"是什么意思?在 CSS 属性选择器中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!