我需要這個代碼的小幫助。我正在嘗試創建一個菜單。 我在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