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

2. 盒子模型 #2

Open
linrunzheng opened this issue Aug 5, 2021 · 0 comments
Open

2. 盒子模型 #2

linrunzheng opened this issue Aug 5, 2021 · 0 comments

Comments

@linrunzheng
Copy link
Owner

盒子模型定义了盒子的每个部分,包括margin,padding,content,border, 这几个部分共同组成了每一个盒子。

盒子模型分为标准盒子模型以及ie盒子模型。

  • 标准盒子模型: width就是content的内容,盒子的宽度是 content + padding + border。
  • ie盒子模型:width是content + padding + border这是三部分的宽度,盒子的宽度就是width。

可以通过box-sizing来设置,默认是content-box,可以设为border-box,通常也会在样式重置时统一设为border-box。

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

No branches or pull requests

1 participant