CSS Magic Hall: A brief introduction to the box model

Source: Internet
Author: User

First, the standard box model

Second, IE box model

The difference between the two models          

Standard Box Model:

Outer box model

Element space width = content width + padding + border + margin

Element space height = content width + padding + border + margin height

Inner box model

Element width = Content height + padding + border width

Height of element = content height + padding + border

E Box Model:

Outer box model

Element space width = width of content width + margin

Element space height = height of content height + margin

Inner box model

Element width = content widths

Element altitude = content Height

The IE box model will be used when ie6~8 is in weird mode, otherwise the standard box model will be used.

Iv. Rules of CSS3--box-sizing

The box-sizing has three values, the default is Content-box (which means that the element uses the world model), and Border-box (which represents the element using the IE box model), Inherit (inherited from the parent element)

Browser support: IE8 start support

element{  //  firefox3.5+  //  Opera9.6 (Presto core)  //  safari3.2+  //  IE8  //  ie9+,chrome10.0+,safari5.1 +,opera10.6}

V. Summary

Box model is the basis of CSS, although IE has been criticized by everyone, but does not mean that the IE box model than the standard box model, the next we study together CSS3 style rules box-sizing understand.

Respect the original, reprint please indicate from: http://www.cnblogs.com/fsjohnhuang/p/3967623.html ^_^ Fat Boy John

Vi. references

Http://www.cnblogs.com/releaseyou/archive/2009/04/16/1437456.html

http://blog.csdn.net/ncode/article/details/7428746

Http://www.w3cplus.com/content/css3-box-sizing

CSS Magic Hall: A brief introduction to the box model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.