W3C box and IE box model, w3c box ie

Source: Internet
Author: User

W3C box and IE box model, w3c box ie

Box Model:

Content, padding, margin, and border)

The content section of IE calculates border and padding.

Example: A box

Margin is 20px, border is 1px, padding is 10px,

The content width is 200px and the height is 50px,

Standard w3c box model:

Occupied position: content + padding + border (margin );

Occupied position: 20*2 + 1*2 + 10*2 + 200 = 262px, 20*2 + 1*2*10*2 + 50 = pixel PX;

Actual box size: content + padding + border (border );

The actual size of the box is: 1X2 + 10x2 + 200 = 222px, 1X2 + 10x2 + 50 = 72px;

Ie box model:

Occupied location: content + boundary (margin );

Occupied position: 20*2 + 200 = 240px, 20*2 + 50 = 70px,

Actual size of the box: content );

The actual size of the box is 200px in width and 50px in height.

Details: http://www.cnblogs.com/cchyao/archive/2010/07/12/1775846.html

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.