Two box models in web pages (W3C box model, IE box model)

Two box models in web pages (W3C box model, IE box model)
There are two types of web page box models:

1: Standard W3C box model; 2: IE box model (the default model of IE browser).

In two different model web pages, the display effects of elements with the same CSS properties defined are different. The following formula is used to distinguish these two different box models.

1: Standard W3C box model

Width = width + (padding-left) + (padding-right) + (margin-left) + (margin-right) + (border-left) + (border-right)
Height = height + (padding-top) + (padding-bottom) + (margin-top) + (margin-bottom) + (border-top) + (border-bottom)

2: IE box model

width = width + (border-left) + (border-right)
Height = height + (border-top) + (border-bottom)

This model is the default box model of IE browser, of course, it can also be changed

<<:  Detailed explanation of the basic usage of the img image tag in HTML/XHTML

>>:  Summary of fragmented knowledge of Docker management

Recommend

JavaScript using Ckeditor + Ckfinder file upload case detailed explanation

Table of contents 1. Preparation 2. Decompression...

Vuex implements simple shopping cart function

This article example shares the specific code of ...

Solution to forgetting mysql password under linux

The problem is as follows: I entered the command ...

MySQL obtains the current date and time function example detailed explanation

Get the current date + time (date + time) functio...

Vue implements the magnifying glass function of the product details page

This article shares the specific code of Vue to i...

SQL serial number acquisition code example

This article mainly introduces the sql serial num...

Issues with upgrading Python and installing Mongodb drivers under Centos

Check the Python version python -V If it is below...

WeChat Mini Program QR Code Generation Tool weapp-qrcode Detailed Explanation

WeChat Mini Program - QR Code Generator Download:...

Use scripts to package and upload Docker images with one click

The author has been working on a micro-frontend p...

A brief discussion on the magic of parseInt() in JavaScript

cause The reason for writing this blog is that I ...

How to write high-quality JavaScript code

Table of contents 1. Easy to read code 1. Unified...

Specific usage of Vue's new toy VueUse

Table of contents Preface What is VueUse Easy to ...

Detailed explanation of common usage methods of weixin-js-sdk in vue

Link: https://qydev.weixin.qq.com/wiki/index.php?...

Detailed explanation of NodeJS modularity

Table of contents 1. Introduction 2. Main text 2....