JQuery to determine CSS box model (box model boxes models) _jquery

Source: Internet
Author: User
If the page contains a valid DOCTYPE declaration, it is rendered in strict mode.
If the page does not have a DOCTYPE declaration or a valid DOCTYPE declaration, it is rendered in compatibility mode.
There is a difference between the two modes, the main difference between the two rendering modes is the calculation of the element width and the height style. Like the following style
Copy Code code as follows:

{
width:180px;
height:72px;
padding:10px;
bording-width:5px;
}

In the strict mode of the 180*72px, the content of the element is displayed in the range of the contents. The inner margin and border are outside the range of 180*72 pixels. So the coverage area of the entire element is: width:180 + 10*2 + 5*2 = 210px,height:72 +10*2 + 5*2 =102px.
In IE compatibility mode the entire element covers an area of 180*72 pixels. The size of the content is reduced to the width 180-10*2-5*2=150px, the height 72-10*2-5*2 =32px.
The method of using jquery to Judge Box modal is simple. Is the $.BOXMODEL flag by type bool. Returns true if the page is a model of the standard for the web. otherwise return false.

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.