CSS Basic Boxes

2008 Oct 17


Every element has a rectangular region called the element box which has four parts. Also the content and padding background can be a color or (an optionally tiled) image. Margins are always transparent allowing the background of the parent element(s) to be visible. Padding cannot be negative, but margins can be negative. Borders have a set of possible styles and a color (which defaults to the color of the element's contents).

The containing block is formed by the content edge of the nearest block-level, table cell or inline-block ancestor box.