Current location - Education and Training Encyclopedia - Education and training - CSSDIV pencil box model
CSSDIV pencil box model
There are two web box models:

1: standard W3C box model; 2.IE box model (default model of IE browser).

In two different models of web pages, the display effect of elements with the same CSS attribute is different. Let's use formulas to distinguish these two different box models.

1: standard W3C box model

Width = width (left padding) (right padding) (left margin) (right margin) (left border) (right border).

Height = height (padding-top) (padding-bottom) (margin-top) (margin-bottom) (border-top) (border-bottom).

2.IE box model

Width = width (left border) (right border)

Height = height (border-top) (border-bottom)

This model is the default box model of IE browser. Of course, you can also change it by adding the following code at the top of the page:

1