html下拉菜单的子目录,html - 带有下拉菜单的子菜单的垂直下拉菜单 - 堆栈内存溢出...

我想用以下结构制作一个垂直下拉菜单(对于每个“按钮”一个不同的“下拉” div)。这个想法是当我将“按钮”悬停时,“下拉”以相同的方式出现在“按钮”上大小 (“下拉列表”缩小为高度“ subnav1”相等的“按钮”大小)或显示在“下拉列表”的左侧 (再次具有“ subnav1”高度相等)。 但是,问题是我无法显示 “下拉” :在“按钮”悬停时阻止 s,在第二种情况下,选择“ subnav1”元素时要悬停“按钮”。 HTML:

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;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值