Chapter 7. Creating Spacing for Text

So far, most of the example pages you’ve seen as well as the exercise files you’ve worked on have had no spacing within or between columns; the text just sits up against the edges of the background colors on the columns. You might think that adding spacing for the text would be as easy as slapping a margin or some padding onto the divs, but it’s not necessarily that simple. Adding spacing without making other adjustments elsewhere in the CSS could cause your layout to fall apart entirely. But never fear—I’ll teach you how to work with margin and padding successfully in a variety of flexible layouts.

Matching Units of Measurement

You’ll have the easiest time adding spacing for text if you measure it in the same ...

Get Flexible Web Design: Creating Liquid and Elastic Layouts with CSS now with O’Reilly online learning.

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