vimwiki

Css attribute selector

Select element by their attributes or attributes values. Use with the bracket []

It has the same specificity as classes 0,0,1,0.

Example

[src] {...}

img[src] {...}

img[src="img.jpg"] {...}

For more complex slection you can use these:

Note: they also work with classes, like so: [class^="cla"]

Example:

[class^"aus"] {
  /* 
    select:
      class="australia"
      class="austria"
      ...
  */
}

[src$=".jpg"] {...}

[src*="ill"] {
  /* 
    select:
      src="bill.jpg"
      src="silly.jpg"
      src="ill.jpg"
      ...
  */
}

More on it