【发布时间】:2015-06-27 19:58:09
【问题描述】:
所以我在悬停时有这个过渡,它在被悬停的元素底部形成一个边框。一切都很好,但是当鼠标离开元素时,边框会消失,而我希望它再次“缩回”。 Codepen
HTML:
<div class="object">
<p>Object</p>
</div>
CSS:
* {
background-color: #222;
color: white;
font-family: sans-serif;
font-size: 30pt;
}
p {
width: 200px;
height: 100%;
margin-top: 70px;
text-align: center;
transition: 0.2s border-bottom;
-webkit-transition: 0.2s border-bottom;
margin: auto;
margin-top: 50px;
}
p:hover {
border-bottom: 5px solid white;
}
我将如何做到这一点,尽可能简单? 谢谢;3
【问题讨论】:
标签: html css css-transitions