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 ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.