Thursday, June 20, 2024
HomeSoftware DevelopmentCase Insensitive CSS Attribute Selector

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 guardian/baby/sibling relationships, very seldomly in worth matching. Take into account my shock once I discovered that CSS permits matching attribute values regardless off case!

Including a {house}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 seemingly very restricted, particularly if this flag is knew data for you and also you’re used to an ordinary lower-case normal. A unfastened CSS classname normal can have and would proceed to result in issues, so use this case insensitivity flag sparingly!

  • 5 HTML5 APIs You Didn’t Know Existed

    While you say or learn “HTML5”, you half count on unique dancers and unicorns to stroll into the room to the tune of “I am Horny and I Know It.”  Are you able to blame us although?  We watched the basic APIs stagnate for therefore lengthy {that a} primary function…

  • CSS 3D Folding Animation


Supply hyperlink
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments