css box model Box Model

Properties: content (content), Padding (padding), border (border), margins (margin), CSS box model possess these attributes.

   CSS box model is a kind of mental model often used in web design CSS techniques used.

Category box: box type produced by different elements may vary, one element, what kind of box generated, depending on its CSS display property

display: none: does not generate box

display: inline: Line box

display: block: block boxes

Box consists of:

Margin (margins) - clear the area outside of the frame, it is transparent from the outside.

Border (Borders) - around the inner and outer margins content border.

Padding (padding) - clear the area around the content, padding is transparent.

Content (content) - the contents of the box to display text and images.

Example:

div {
    width: 300px;
    border: 25px solid green;
    padding: 25px;
    margin: 25px;
}

 

 

Guess you like

Origin www.cnblogs.com/muxi95/p/11516745.html