Skip to content
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

[css] 第69天 请说说*{box-sizing: border-box;}的作用及好处有哪些? #495

Open
haizhilin2013 opened this issue Jun 23, 2019 · 5 comments
Labels
css css

Comments

@haizhilin2013
Copy link
Collaborator

第69天 请说说*{box-sizing: border-box;}的作用及好处有哪些?

@haizhilin2013 haizhilin2013 added the css css label Jun 23, 2019
@haizhilin2013 haizhilin2013 changed the title [css] 第69天 请说说*{box-sizing: border-box;}的作用及好处有哪些? [css] 第69天 请说说*{box-sizing: border-box;}的作用及好处有哪些? Jun 24, 2019
@git710
Copy link

git710 commented Jun 24, 2019

作用: 将padding和border包括在width内

好处: 更符合我们通常对一个「盒子」尺寸的认知,省掉一些计算

@Vi-jay
Copy link

Vi-jay commented Jul 31, 2019

还是喜欢用默认的content-box 不考虑老版ie 比较通配符的性能较差 第三方的UI库的盒模型也都是标准盒模型

@kruzabc
Copy link

kruzabc commented Jan 7, 2020

很多网站和样式都是 boder-box , 包括淘宝h5版本5和饿了么。 boder-box 对元素设定固定尺寸之后js获取到的值是固定的。

@smile-2008
Copy link

作用: 将padding和border包括在width内

好处: 更符合我们通常对一个「盒子」尺寸的认知,省掉一些计算

@zxcdsaqwe123
Copy link

这样不管border和padding的值是多少,盒子在页面中的占地大小不会发生改变

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

6 participants