试图让“tab2”随着导航栏移动。(当您将鼠标悬停在导航栏上时,框会随之移出) http://jsfiddle.net/Bz5mn/ 帮助!
#nav
{
min-width: 60px;
width:5%;
height:100%;
background-color: rgba(1,1,1,0.3);
position: absolute;
top: 0;
left: 0;
transition-duration:0.4s;
overflow: hidden;
}
试图让“tab2”随着导航栏移动。(当您将鼠标悬停在导航栏上时,框会随之移出) http://jsfiddle.net/Bz5mn/ 帮助!
#nav
{
min-width: 60px;
width:5%;
height:100%;
background-color: rgba(1,1,1,0.3);
position: absolute;
top: 0;
left: 0;
transition-duration:0.4s;
overflow: hidden;
}
试试相邻的兄弟选择器。你可以做类似的事情
#nav:hover + #tab2 {
margin-left: 5%;
}
您还希望将过渡添加到#tab2
声明中,以便动画匹配。
另请注意,此选择器仅适用于 IE 9+