我已经将高度过渡应用到了一个框,但它只影响边框而不影响其中的文本.我希望文本随框慢慢缩小,如何实现缓慢过渡以隐藏文本?
代码:
<div class="test">
this is my test
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.test {
transition: height 2s, ease-in;
height: 400px;
width: 600px;
border: 1px solid red;
}
.test:hover{
height: 1px;
}
Run Code Online (Sandbox Code Playgroud)
小智 6
添加溢出:隐藏;
.test {
transition: height 2s, ease-in;
height: 400px;
width: 600px;
border: 1px solid red;
overflow: hidden;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31 次 |
| 最近记录: |