Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As for CSS 2.1, see <a href="http://www.w3.org/TR/CSS21/selector.html#attribute-selectors" rel="noreferrer">http://www.w3.org/TR/CSS21/selector.html#attribute-selectors</a></p> <p>Executive summary:</p> <pre> Attribute selectors may match in four ways: [att] Match when the element sets the "att" attribute, whatever the value of the attribute. [att=val] Match when the element's "att" attribute value is exactly "val". [att~=val] Match when the element's "att" attribute value is a space-separated list of "words", one of which is exactly "val". If this selector is used, the words in the value must not contain spaces (since they are separated by spaces). [att|=val] Match when the element's "att" attribute value is a hyphen-separated list of "words", beginning with "val". The match always starts at the beginning of the attribute value. This is primarily intended to allow language subcode matches (e.g., the "lang" attribute in HTML) as described in RFC 3066 ([RFC3066]). </pre> <p><a href="http://www.w3.org/TR/css3-selectors/#selectors" rel="noreferrer">CSS3 also defines a list of selectors</a>, but <a href="http://rakaz.nl/item/how_well_do_browsers_support_css_selectors" rel="noreferrer">the compatibility varies hugely</a>. </p> <p>There's also <a href="http://tools.css3.info/selectors-test/test.html" rel="noreferrer">a nifty test suite</a> that that shows which selectors work in your browser.</p> <p>As for your example,</p> <pre><code>a[href^=http] { background: url(external-uri); padding-left: 12px; } </code></pre> <p>should do the trick. Unfortunately, it is not supported by IE.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload