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

5、说一下你对盒模型的理解 #5

Open
shiwanjun1995 opened this issue Jan 19, 2022 · 0 comments
Open

5、说一下你对盒模型的理解 #5

shiwanjun1995 opened this issue Jan 19, 2022 · 0 comments

Comments

@shiwanjun1995
Copy link
Owner

shiwanjun1995 commented Jan 19, 2022

盒模型有两种:标准盒子模型、IE盒子模型(怪异盒子模型)。

4544d45b5a0c47a58c0c33a7d8fbac09_tplv-k3u1fbpfcp-watermark

4040de9fef1a49f4ae0ae66039edcfe0_tplv-k3u1fbpfcp-watermark

盒子模型是由四个部分组成的:margin、border、padding 和 content。

它们之间的区别在于设置宽高的时候所对应的范围是不一样的:
标准盒子模型:box-sizing: content-box; (宽高包含 content)
IE盒子模型:box-sizing: border-box; (宽高包含 content + padding + border)

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

No branches or pull requests

1 participant