css-standard box model & weird Box model

Source: Internet
Author: User
Box model category in CSS

The box model in CSS is divided into two categories:: The Standard and IE standard box models.

Most browsers use the Web-Consortium standard Model, while IE uses Microsoft's own standards.

The weird mode is "some browsers support the standard of the consortium while retaining the original parsing mode", the strange mode is mainly in the IE kernel browser.

When DOCTYPE is not defined, strange patterns are triggered.

in standard mode, the total width of a block = width + margin (left) + padding (left) + border (left or right )

in weird mode, the total width of a block = width + margin (that is, width already contains padding and border values)

CSS3 's box-sizing

Box-sizing Syntax:

Box-sizing:content-box | | Border-box | | Inherit

when set to Box-sizing:content-box, the standard mode is used to parse the calculation and the default mode.

when set to Box-sizing:border-box, the odd mode is used to resolve the calculation.

Related Article

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.