CSS/Selectors/attribute selector/attribute*=value

From W3C Wiki
< CSS‎ | Selectors
Jump to: navigation, search


This selector represents an element with the "attributename" attribute whose value contains at least one instance of the substring "val".


elementname[attributename*="val"]{ properties }

Point, Note

  • If "val" is the empty string then the selector does not represent anything.



   color: red;


  <h1 title="About HTML5">About HTML5</h1>
  <h1 title="HTML5 Spec">HTML5 Spec</h1>
  <h1 title="New HTML5 Element">New HTML5 Element</h1>

Css3 selectors att 007.png

CSS defines the attribute selector in 6.3.2. Substring matching attribute selectors.