html下拉菜单的子目录,html - 带有下拉菜单的子菜单的垂直下拉菜单 - 堆栈内存溢出...
我想用以下結構制作一個垂直下拉菜單(對于每個“按鈕”一個不同的“下拉” div)。這個想法是當我將“按鈕”懸停時,“下拉”以相同的方式出現在“按鈕”上大小 (“下拉列表”縮小為高度“ subnav1”相等的“按鈕”大小)或顯示在“下拉列表”的左側 (再次具有“ subnav1”高度相等)。 但是,問題是我無法顯示 “下拉” :在“按鈕”懸停時阻止 s,在第二種情況下,選擇“ subnav1”元素時要懸停“按鈕”。 HTML:
SUBBUTTON1
SUBBUTTON1
SUBBUTTON1
CSS:
.nav {
width: 180px;
padding: 1vm;
float:left;
height:450px;
position:relative;
text-align:center;
background-color:#a56d3b;
}
ul{
list-style:none;
margin: 0;
padding: 0;
text-align:right;
}
.nav a{
text-decoration:none;
}
.subnav{
font-weight:bold;
text-align:center;
color:#FCFBE3;
font-family: 'PT Serif', serif;
font-size:1.3em;
display:block;
}
.button{
border-bottom:1PX DOTTED #FFECBA;
border-right:1PX DOTTED #FFECBA;
height:90px;
width:100%;
padding:2em 0 0 0 ;
cursor:pointer;
}
.button:last-child{
border-bottom:0px;
}
.button:hover{
background-color:rgba(0,0,0,0.5);
}
.dropdown{
height:89px;
float:left;
width:auto;
min-width:100px;
text-align:center;
margin:0 180px;
position:absolute;
cursor:pointer;
border:1px solid black;
}
.subnav1{
height:30px;
width:180px;
padding:5px 0;
color:black;
font-family: 'PT Serif', serif;
font-size:1em;
color:white;
text-decoration:none;
background-color:#D8A06E;
DISPLAY:BLOCK;
}
.subnav1:hover{
background-color:rgba(0,0,0,0.5);
}
.nav.nav1 .button:hover .dropdown{
display:block;
}
總結
以上是生活随笔為你收集整理的html下拉菜单的子目录,html - 带有下拉菜单的子菜单的垂直下拉菜单 - 堆栈内存溢出...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎样才能知道我的车支持无损音乐汽车怎么听
- 下一篇: 俄语使用计算机怎么说,计算机俄语常用词汇