Styling the HeadingTo style this heading, you will need a selector that targets the <h2> element. To make sure you don't target every <h2> on the page, you should also include a class within the selector. A class is used in this case instead of an ID because you might want to include more than one of these fixed-width headings on a single page (see Listing 9.1). Listing 9.1. CSS Code Showing the Selectors to Style the Headingh2.decorative {...} h2.decorative em {...} The HTML code used for this heading is shown in Listing 9.2. Notice that the heading is wrapped inside an <em> (emphasis) element. This additional element will be important later in the lesson. Listing 9.2. HTML Code Containing the Markup for a Heading<h2 class="decorative"> <em>Section Heading</em> </h2> |