Caret (^): selects an element (<h1>
) where the value of the specified attribute (rel
) starts with a certain value (val
):
h1[rel^="val"] { /** formatting */ }
h1[rel^="friend"] { color: blue; }
<h1 rel="friend-external-sandwich">I'm Blue.</h1>
<h1 rel="friend2-external-sandwich">I'm Blue.</h1>
<h1 rel="external-sandwich">I'm Black.</h1>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…