O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

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

Selecting Elements by Class or ID

If you’ve labeled elements with a class Image or an id (see Chapter 3), you can use that criterion in a selector to apply formatting to only those elements that are so labeled Image.

Image There are two article elements with a class of about. A short paragraph without the class is in between them.

...<article id="gaudi" class="about">    <h1>Antoni Gaudí</h1>    <p>Many tourists are drawn to Barcelona to see Antoni Gaudí's incredible ...

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