CSS - Boxes (Box Model)

> (World Wide) Web - (W3|WWW) > CSS - Cascading Style Sheets - Markup Language (HTML|XML) Skin > CSS - Boxes (Box Model)

1 - About

The Box model means that each element is represented as a rectangular box.

The rendering engine (ie of the user agent) determines:

With CSS, every element is made up of nested boxes known as the margin, border, padding, and content.

Advertising

3 - Properties

3.1 - Dimension

3.2 - Type / Formatting

The html element defines the default box type that can be overridden by the display property.

The two most known boxes are:

A box's type affects its rendering behavior (for short inline or to a new line).

  • The block box expands to fill the width of the entire window. The html ul element for instance will have this behavior because it is a block-level element (ie block box). By default, block-level elements expand to fill their container elements and force any subsequent sibling elements further down the page.
  • The inline elements rest in line with each other, not stacked on top of each other like blocks. Common inline elements include strong, em, a, and span. By default, Inline elements do not expand to fill extra space, and happily exist side by side, next to their fellow inline neighbors.
Advertising

3.3 - Position / Layout

The box content is not confined by this containing block; it may overflow.

CSS - (Box) Positioning (Scheme)

The layout of boxes is governed by:

4 - Configuration

5 - Reference

Advertising
web/css/box/box.txt · Last modified: 2019/02/09 11:40 by gerardnico