CSS basic style [two]-box model

table of Contents

 

Introduction to the box model

composition

The horizontal layout of the box.

Box model-vertical layout

Box model for inline elements


Mold box type described

When using CSS for web page layout, we must be inseparable from the box model. The box model, as the name suggests, the box is used to hold things, and the things it holds are the content of HTML elements.

The English name of the box model (CSS box model)

composition

  A box can be divided into four parts from the outside to the inside: margin, border, padding, content. In css, each element is regarded as a box, and each A box has three attributes:

border: The border of the element (may not be visible), used to separate the edge of the box from other boxes,

Margin: The outer margin, which means the distance between the edge of the box and the neighbor, also called margin;

padding: inner margin, representing the space between the box content and the border,

By using CSS to realize the separation of page content and presentation form, work efficiency is greatly improved.

 

The horizontal layout of the box.

 

Box model-vertical layout

Box model for inline elements

 

 

Guess you like

Origin blog.csdn.net/weixin_43472073/article/details/113242527