Skip to content

[css] 第103天 说说你对低版本IE的盒子模型的理解 #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haizhilin2013 opened this issue Jul 27, 2019 · 4 comments
Open
Labels
css css

Comments

@haizhilin2013
Copy link
Collaborator

第103天 说说你对低版本IE的盒子模型的理解

@haizhilin2013 haizhilin2013 added the css css label Jul 27, 2019
@LinStan
Copy link

LinStan commented Jul 28, 2019

低版本的IE盒子指的是 content包含padding和border在内的盒子模型
即content宽高=width/height+padding2+border2

可以通过设置box-sizing:border-box来指定使用IE盒子模型

@EmiyaYang
Copy link

一个CSS盒子由四部分组成,由内到外依次是:content、padding、border、margin。

所谓盒子模型定义的是盒子宽高的计算方法,IE盒子模型的宽高为content、padding、border之和。而W3C盒子的宽高仅为content。从页面布局来说前者实际上更实用一点,这也是后来W3C提供box-sizing属性用于切换盒子模型的原因。

@EragonBubble
Copy link

盒子模型:content,padding,border,margin
W3C盒子宽高为content的宽高; box-sizing: content-box;
IE盒子宽高,content + padding + border; box-sizing: border-box;

@smile-2008
Copy link

一个CSS盒子由四部分组成,由内到外依次是:content、padding、border、margin。

所谓盒子模型定义的是盒子宽高的计算方法,IE盒子模型的宽高为content、padding、border之和。而W3C盒子的宽高仅为content。从页面布局来说前者实际上更实用一点,这也是后来W3C提供box-sizing属性用于切换盒子模型的原因。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css css
Projects
None yet
Development

No branches or pull requests

5 participants