O'Reilly logo

Web Technology: Theory and Practice by M. Srinivasan

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

3.5 BOX MODEL

The Style properties that can be defined using CSS can be considered to be grouped into two categories—Layout properties and Formatting properties. To understand the layout properties, it (element) is best visualized as a (imaginary) rectangular area for display. It is represented in Figure 3.4.

 

CSS box model

 

Fig. 3.4 CSS box model

3.5.1 Concept

CSS considers each element as a box. A piece of text (or any content), if displayed as-is, will not look appealing, so it is implicitly wrapped over layers. How these layers stack up together, is defined by the Box model, made up of the Content area, along with Padding, Border and Margin. The Content ...

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