In CSS, you may encounter an attribute selector with an appended "i", like the following example from the Google Chrome user agent stylesheet:
[type="checkbox" i]
This "i" designates case-insensitive attribute matching, an innovation introduced in CSS Selectors Level 4.
While this feature is currently supported in popular browsers such as Chrome (49 ), Firefox (47 ), Safari (9 ), and Opera (37 ), it was initially only available in Chrome's user-agent styles around Chrome 39. Web developers could enable it for web content by configuring an experimental features flag.
Here's a quick demonstration to test browser support:
<!-- Color will be green on supported browsers, red on unsupported --> <div data-test="A"></div>
[data-test] { width: 100px; height: 100px; margin: 4px; } [data-test="A"] { background: red; } [data-test="a" i] { background: green; }
The above is the detailed content of What is the Purpose of the \'i\' Flag in CSS Attribute Selectors?. For more information, please follow other related articles on the PHP Chinese website!