O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

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

The Box Model

CSS treats your Web page as if every element it contains were enclosed in an invisible box. The box is made up of a content area, the space surrounding that area (padding), the outside edge of the padding (border), and the invisible space around the border that separates one element from the next (margin). It’s sort of like a framed picture on a wall, where the picture is the content, the matting is the padding, the frame is the border, and the distance between that frame and the next one is the margin Image.

Image Each element’s box has four ...

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