Laying the Groundwork

First we need an image and a sentiment appropriate to the season. Figure 8.1 shows what we have to start with.

Figure 8.1. The basic greeting card, not yet styled with CSS.

To allow for effective styling, we need to add to the page structure. In this case, we’re going to want maximum flexibility, so we’ll enclose each line in its own div and wrap the whole thing in an overarching div. Along the way, we’ll knock out all of the <br> elements because we won’t need them any more. The block-level nature of the div elements will take care of the line breaking for us. Listing 8.1 shows the changes.

Listing ...

Get Eric Meyer on CSS: Mastering the Language of Web Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.