O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Simple Attribute Selector

Pattern:

element1[attr]

Description:

This allows authors to select any element based on the presence of an attribute, regardless of the attribute’s value.

Examples:

a[rel] {border-bottom: 3px double gray;}
p[class] {border: 1px dotted silver;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required