【发布时间】:2013-11-07 08:19:35
【问题描述】:
我能够成功创建一个导航菜单,其中包含悬停时显示的子菜单。但是,我希望我的子菜单有列。我在创建悬停导航时使用了 Vanga Sasidhar 的技巧,现在我需要在解决方案和支持菜单项下创建列。
这是我的 jsfiddle:http://jsfiddle.net/DKu7p/。
这是我的 CSS:
.site-nav li {
display:block;
float:left;
list-style:none;
margin: 0;
position: relative;
width: 100px;
}
.site-nav li:hover {
background:#1f78c3;
cursor:pointer;
}
.site-nav li a {
color:#696969;
display:block;
text-align:center;
text-decoration:none;
padding:5px 10px;
}
.site-nav li a:hover {
color:#00598B;
display:block;
text-align:center;
text-decoration:none;
padding:5px 10px;
}
.site-nav .dropdown {
display : none;
position : relative;
}
.site-nav .dropdown li { float : none; }
.site-nav li:hover .dropdown { display : block; position: relative; }
.dropdown {
background: #fff;
border: 1px solid #fff;
border-top: 0;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
list-style: none;
margin: 4px 0 0 -9px;
min-width: 150px;
overflow: hidden;
padding: 0;
position: relative;
z-index: 999;
}
.dropdown li {
border: 0;
border-radius: 0;
clear: both;
float: none;
font-size: .9em;
margin: 0;
width: 100%;
}
.dropdown li span {
display: none !important;
}
.dropdown li a {
background: none;
color: #333;
display: block;
font-size: 1.1em;
font-weight: normal;
padding: 5px 8px;
text-align: left;
text-shadow: none;
}
.dropdown li a:hover {
background: #ddd;
color: #0c84bb;
text-decoration: none;
}
.dropdown .last a {
border-bottom: none;
}
【问题讨论】:
-
你确定.. column1 和 column3 应该放在左边; colum2 应该放在右边,对吗?
-
我希望列 1 2 和 3 彼此相邻,并且在每一列下我都会有其他主题。在另一个问题 (jsfiddle.net/qtvVK/11) 上发布了一个 jsfiddle,但我无法使用我正在使用的代码 (jsfiddle.net/DKu7p) 重新创建它。我不确定我做错了什么。
-
让我试试,一秒(应该是一小时)..
标签: html css navigation multiple-columns submenu