08. The Box Model

Image

Image Reminder

THE CODE EXAMPLES FOR THIS CHAPTER CAN BE DOWNLOADED FROM THE WEBSITE (HTTP://FOUNDATIONSOFWEBDESIGN.COM).

All HTML elements displayed in the browser are drawn in a “box” shape. While the shape isn’t always a perfect square, it does have four sides—top, right, bottom, and left—and a central content area surrounded by an area of padding, then a border, then an outer margin area (Figure 8.1). CSS can target these sides to manipulate elements in various ways; for example, by adding padding, margins, and borders to the ...

Get Foundations of Web Design: Introduction to HTML & CSS now with O’Reilly online learning.

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