我需要这个代码的小帮助。我正在尝试创建一个菜单。 我在jsFiddle使用悬停的移动div
我的问题证明这是一个按钮(这是不是一个真正的按钮)继续移动,因为我在它悬停,有什么方法可以用来保持它在哪里?
下面是我的一些代码
<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;
}
是的,但我想灰色框在黑线上,没有“测试”在其中 – LegendaryLaggy
@ user1951751:我不确定你的意思。 – Blender
我想实现类似于我所展示的内容,但是我不希望灰色框超出黑色线条,如果这使得任何意义:) – LegendaryLaggy