5.8. Properties of the Bounding Box

Cascading style sheets assume that all elements will result in one or more rectangular regions. Such a region is known as the “bounding box” (or simply “box”) and contains a margin, border, padding area, and main element, each nested within the other. The width and height of the total box is the sum of the width and height of the main element, the padding area that surrounds the main element, the border surrounding the padding, and the margins surrounding the border. Margins are always transparent, letting the color or image underneath show through. The padding always takes on the background color or image of the main element. The border, which is in between, can have a separate background. For instance, you ...

Get Core Web Programming, Second Edition now with O’Reilly online learning.

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