Width in CSS

Source: Internet
Author: User

The browser uses CSS to render pages for the description of the element's box model. Therefore, the width of the element is affected by the parent element and the CSS description.

Typically, the width of an element is the width of the content-box in the box model. That is, the default Box-sizing:content-box. Here, the width of the CSS is consistent with the width of the graph.

When setting Box-sizing:border-box, there are also width, innerwidth, outerwidth and the like, but the width of the CSS setting is equal to Outerwidth (false):

Other conditions

Box-sizing is the ability provided by CSS3. The browser support situation is as follows:

Nonetheless, the width,ie7 of CSS settings is still considered content-box, while IE5 is considered border-box.

Compatibility setting Width:

. box {

width:100px; /*firefox*/

*width:100px; /*ie7*/

_width:100; /*ie6*/

}

Reference:

http://caniuse.com/

Width in CSS

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.