CSS [attribute|=value] Selector

❮ Previous Selectors Next ❯

Example

p[lang|="en"] {
  background: red;
}

Meaning

The [attribute|=value] selector select elements with the specified attribute starting with the specified value.

The above example would then affect English paragraphs but not paragraphs that have no language specified or a different value than an English variation.

Version: CSS2




Standard Syntax

[attribute|=value] {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







❮ Previous Selectors Next ❯