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

MySQL statement execution order and writing order example analysis

The complete syntax of the select statement is: S...

Common writing examples for MySQL and Oracle batch insert SQL

Table of contents For example: General writing: S...

10 skills that make front-end developers worth millions

The skills that front-end developers need to mast...

Linux Domain Name Service DNS Configuration Method

What is DNS The full name of DNS is Domain Name S...

Introduction to ufw firewall in Linux

Let's take a look at ufw (Uncomplicated Firew...

React + Threejs + Swiper complete code to achieve panoramic effect

Let’s take a look at the panoramic view effect: D...

About the IE label LI text wrapping problem

I struggled with this for a long time, and after s...

Vue's guide to pitfalls using throttling functions

Preface In a common business scenario, we need to...

A brief discussion on Yahoo's 35 rules for front-end optimization

Abstract: Whether at work or in an interview, opt...

Three common style selectors in html css

1: Tag selector The tag selector is used for all ...

Search optimization knowledge to pay attention to in web design

1. Link layout of the new site homepage 1. The loc...

Using loops in awk

Let's learn about different types of loops th...