What Is the HTML Element Formatting Model

Q

What Is the HTML Element Formatting Model? - CSS Tutorials - HTML Formatting Model: Block, Inline and Floating Elements

✍: FYIcenter.com

A

An HTML document is divided into HTML elements. Each element is considered as a formatting unit using a box-oriented formatting model, which has:

  • Content Box - A rectangular area for displaying the element content.
  • Padding Box - A rectangular area surrounding the content box acting as padding space.
  • Border Box - A rectangular area surrounding the padding box acting as border lines.
  • Margin Box - A rectangular area surrounding the border box acting as margin space.

The diagram below shows you the content box of a paragraph and the surrounding layers:
           

2007-05-11, 4585👍, 0💬