10.4 C
New York
Tuesday, April 1, 2025

Case Insensitive CSS Attribute Selector


CSS selectors by no means stop to amaze me in how highly effective they are often in matching complicated patterns. Most of that flexibility is in dad or mum/baby/sibling relationships, very seldomly in worth matching. Contemplate my shock after I realized that CSS permits matching attribute values regardless off case!

Including a {area}i to the attribute selector brackets will make the attribute worth search case insensitive:

/* case delicate, solely matches "instance" */
[class=example] {
  background: pink;
}

/* case insensitive, matches "instance", "eXampLe", and so forth. */
[class=example i] {
  background: lightblue;
}

The use instances for this i flag are probably very restricted, particularly if this flag is knew information for you and also you’re used to a typical lower-case commonplace. A free CSS classname commonplace may have and would proceed to result in issues, so use this case insensitivity flag sparingly!

  • How to Create a Twitter Card
  • Web Audio API

    The Net Audio API permits builders to load and decode audio on demand utilizing JavaScript.  The extra I consider superior video games for Firefox OS TVs, the extra I get to study these APIs that I usually would not contact.  The next is a very fundamental introduction to the WebAudio API…


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles