W3C-Box Model

The background style of the content,padding,and border areas of a box is specified by the 'background' property of the generating element.Margin backgrounds  are always transparent.

 

The margin box height of each box depends on its content height ,plus top and bottom padding ,borders,and margins.Note that vertical margins between

the box may collapse.

The dimension of the  content area of a box -the content width and content height-depend on serveral factors:whether the element generating the box has the 'width' or 'height' property set,whether the box contains text or other boxes,whether the box is a table,etc. 

 

Collapsing margins.In CSS,the adjoining margins of two or more box(which might or might not siblings)can combine to form a single margin .Margins that combine this way are said to collapse ,and the resulting combined margin is called a collapsed margin.

 

The margins of the boxs are transparent --margins are always transparent --so the background color of the boxes padding and content areas shine through them.

你可能感兴趣的:(Model)