offline version v3


295 of 298 menu

Selector by attribute value end

The selector by attribute value end applies a style to an element whose tag attribute value ends with the specified text.

Example

Let's select the a tag, which has the href attribute value that ends with .html and recolor it red:

<a href="file.html">link1</a> <a href="https://code.mu">link2</a> a[href$=".html"] { color: red; }

:

See also

  • an attribute selector
    that searches for an element by attribute name
  • an attribute selector
    that searches for an element by attribute value
  • an attribute selector
    that searches for an element based on the start of an attribute value
  • an attribute selector
    that searches for an element by text in an attribute value
  • an attribute selector
    that searches for an element based on one of attribute values
  • an attribute selector
    that searches for an element by a hyphen in an attribute value
  • the child selector
    that allows you to select elements by direct nesting
  • the descendant selector,
    that allows you to select an element by its parent
  • the adjacent sibling selector
    that allows you to select an element by its sibling
  • the general sibling selector
    that allows you to select elements after a given
  • the universal selector
    that allows you to select all elements
enru