简体   繁体   English

如何将下拉菜单更改为下拉菜单

[英]How to change drop-down menu to drop-up menu

I have this menu bar: http://jsfiddle.net/PtQAP/ and I need to put it to the bottom and the drop-down menu change to drop-up menu. 我有这个菜单栏: http : //jsfiddle.net/PtQAP/ ,我需要将其放在底部,下拉菜单更改为下拉菜单。 How would I do that? 我该怎么做?

css: CSS:

ul, li, a {
    margin: 0;
    padding: 0;
}
li {
    list-style: none;
}
a {
    text-decoration: none;
    color: #000000;
}

ul > li {
    float: left;
}
ul > li a {
    color: #fff;
    font-weight: bold;
    line-height: 40px;
    height:40px;
    display:block;
    padding:0px 10px;
}
ul li a:hover {
    background: #666666;
}
ul li ul {
    display: none;
    position: absolute;
    background: #333333;
}
ul li ul li {
    float: none;
    line-height: 40px;
    height: 40px;
}

Thanks for the answers. 感谢您的回答。

give the bar a position of fixed , and set its bottom to 0px , then set your menu to have a bottom of the height of your bar, in this case 40px 将条形的position fixed ,并将其bottom设置为0px ,然后将菜单设置为具有条形高度的bottom ,在本例中40px

div {
    background: #999999;
    height: 40px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    color: #000000;
    margin: -8px;
    width:100%;
    position:fixed;
    bottom:0px;
    left:0px;
}

ul li ul {
    display: none;
    position: absolute;
    background: #333333;
    bottom:40px;
}

JSFiddle Demo JSFiddle演示

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

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