简体   繁体   English

下拉菜单:在主菜单下水平下拉列表

[英]drop down menu: drop down lists horizontal underneath main menu

below is my js fiddle for a drop down menu, however how do i make the secondary drop down lists a horizontal bar along the bottom of the menu. 以下是我的下拉菜单的js小提琴,但是如何使第二个下拉菜单沿菜单底部列出一个水平条。

http://jsfiddle.net/tcKvH/1/ http://jsfiddle.net/tcKvH/1/

css 的CSS

#header {
height: 100px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
#content {
max-width:700px;
margin-left: auto;
margin-right: auto;
padding: 20px;
}

I am trying to build a menu like the one found here. 我正在尝试建立一个像这里找到的菜单。

http://www.pauledmonds.com/ http://www.pauledmonds.com/

You need to declare #menu with position:relative, and remove that from li. 您需要使用position:relative声明#menu,并将其从li中删除。 This way second ul will expand to the width of #menu. 这样,第二个ul将扩展到#menu的宽度。 Second, you need to make ul ul li { display: inline-block; 其次,您需要使ul ul li {display:inline-block; } and last ul ul { width: 100%; }和最后ul ul {width:100%; left: 0 } 左:0}

#menu li ul li {display: inline-block;}
#menu {
    display: inline-block;
    min-width: 600px;
    list-style:none;
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    position: relative;
}
#menu > li:hover > ul {
    border: 1px solid #FF0000;
    display: block;
    left: 0;
    width: 100%;
}

Here is a link of a working example - Click here 这是一个工作示例的链接- 单击此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM