【发布时间】:2017-01-24 18:48:17
【问题描述】:
我在导航栏上使用 CSS 过渡缓入缓出来实现鼠标悬停。 但是过渡只有在鼠标悬停时才会缓入,并且在光标离开超链接区域后立即恢复,不会平滑缓出。
这是我使用的 CSS:
nav {
position: fixed;
z-index: 1000;
top: 0;
bottom: 0;
width: 200px;
background-color: #036;
}
nav ul {
list-style: none;
margin-top: 15px;
}
nav ul li a {
text-decoration: none;
display: block;
text-align: center;
color: #fff;
padding: 10px 0;
}
.nav-logo {
margin-left: 20px;
background-color: #cacaca;
}
.nav-logo:hover {
transform: scale(1.1);
transition: all 1s ease-in-out;
}
nav ul li a:hover {
background-color: gold;
color: black;
border-radius: 10px;
transform: scale(1.1);
transition: .3s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transform: scale(1.1);
-webkit-transform: scale(1.1);
}
【问题讨论】: