O'Reilly logo

Foundations of Web Design: Introduction to HTML & CSS by Thomas Michaud

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

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

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