我需要这个代码的小帮助。我正在尝试创建一个菜单。我已经在jsFiddle中证明了这一点
我的问题是按钮(它不是真正的按钮)在我将鼠标悬停在它上面时一直在移动,可以使用什么方法将其保持在原位?
这是我的一些代码
<div id="start_bar">
<div id ="start_button">
Test
<div id="nav">
Hello World
</div>
</div>
</div>
和CSS
#start_button{
height:48px;
width:48px;
background-image:url('images/start.png');
color:white;
}
#start_button:hover {
height:48px;
width:48px;
background-image:url('images/start.png');
margin-top: -18px;
}
#nav {
display: none;
}
#start_button:hover > #nav {
display: block;
width: 70px;
height: 150px;
margin-top: -150px;
background-color: grey;
}