O'Reilly logo

Eric Meyer on CSS: Mastering the Language of Web Design 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

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

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