What does a[href^=”…”] do in CSS?

a[href^="http:"] 

Selects an <a> element whose href attribute value begins with http:.

For example:

p[title^="para"] {background: green;}

Will match the following:

<p title="paragraph"> This paragraph should have a green background. </p> 

Leave a Comment