CSS3 height高度auto自适应transition动画
将transition
应用于height:auto;
时 ,浏览器会识别height
值为0
,因此无法直接从height: 0;
过渡到height: auto;
解决方法
div{
max-height: 80px;
transition: all 1s;
}
div:hover{
max-height: 1000px;//尽量设置比较大的值
transition: all 1s;
}
