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
如下 CSS 要实现一个容器从高度 0 正常展开到 auto(或反之)是无效的
0
auto
<div> contents </div>
div { transition: height .2s; } div.active { height: 0; }
使用 grid 布局,把 transition 属性设置为 grid-template-rows,并从 0fr 变化到 1fr 可解决,但需要多套一层 div
grid
transition
grid-template-rows
0fr
1fr
<div class="wrapper"> <div class="inner"> contents </div> </div>
.wrapper { display: grid; transition: grid-template-rows .2s; grid-template-rows: 0fr; } .wrapper.active { grid-template-rows: 1fr; } .inner { overflow: hidden; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
背景
如下 CSS 要实现一个容器从高度
0
正常展开到auto
(或反之)是无效的解决
使用
grid
布局,把transition
属性设置为grid-template-rows
,并从0fr
变化到1fr
可解决,但需要多套一层 divReferences
The text was updated successfully, but these errors were encountered: