CSS Master

(Primo) #1
color: #34444C;
}
[rel~=friend]:hover{
background: #ffeb3b;
border-color: #ffc107;
}

ThisgivesustheimageinFigure1.8.

Figure 1.8. A link to Bob’s website styled using an attribute selector

Matching Hyphenated Attribute Values
Oneofthemoreinterestingtaskswecandowithattributeselectorsismatchelements
withhyphenatedattributevaluesbyusing[attr|=val].Thisselectormatches
elementsbyattributewhenitsvalueishyphenatedanditsprefixequalsval.

14 CSS Master

Free download pdf