gpt4 book ai didi

html - 具有未知尺寸的动画 div 尺寸过渡

转载 作者:太空宇宙 更新时间:2023-11-04 09:05:52 24 4
gpt4 key购买 nike

我想为内容动态变化的 div 大小 (signupForm) 设置动画。

每一步容器div的大小未知。

我更愿意在 CSS 中执行此操作。

我正在使用 Vue.js 来替换表单。

<div class="signupForm">
<component id="currentView">
<FormOne></FormOne>
<FormTwo></FormTwo>
<FormThree></FormThree>
<FormFour></FormFour>
<FormFive></FormFive>
</component>
</div>

#signupForm 永远不会离开,但是 FormOne 会换成 FormTwo,等等。

我添加了以下内容:

.signupForm {
max-height:inherit;
display:inline-block;
transition: max-height 0.3s ease-in-out;
}

但是过渡属性并没有太大帮助。有什么想法吗?

最佳答案

我不确定 max-height 是否有转换的可能性,也许这有帮助:

.signupForm {
max-height:inherit;
display:inline-block;
transition: height 0.3s ease-in-out;
}

关于html - 具有未知尺寸的动画 div 尺寸过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42462353/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com