We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
padding 属性 MDN 和 规范:
padding
Percentages - refer to the width of the containing block
当使用百分比值时,通过包含块的宽度计算。由此可以通过设置 padding-top: 50%; 来实现高度恒为宽度的 50% 效果。
padding-top: 50%;
注意的是,这种实现方式其实是把 padding 撑开,实际上 box 并没有高度。因此当需要在 box 内部再进行布局时,需要放到外面。
CodePen
The text was updated successfully, but these errors were encountered:
No branches or pull requests
padding
属性 MDN 和 规范:当使用百分比值时,通过包含块的宽度计算。由此可以通过设置
padding-top: 50%;
来实现高度恒为宽度的 50% 效果。注意的是,这种实现方式其实是把
padding
撑开,实际上 box 并没有高度。因此当需要在 box 内部再进行布局时,需要放到外面。CodePen
The text was updated successfully, but these errors were encountered: