【问题标题】:How to change drop-down menu to drop-up menu如何将下拉菜单更改为下拉菜单
【发布时间】:2014-05-27 09:54:38
【问题描述】:

我有这个菜单栏:http://jsfiddle.net/PtQAP/ 我需要把它放在底部,下拉菜单变为下拉菜单。 我该怎么做?

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;
}

感谢您的回答。

【问题讨论】:

标签: javascript jquery html css menu


【解决方案1】:

给酒吧一个positionfixed,并将其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

【讨论】:

    猜你喜欢
    • 2019-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-27
    • 1970-01-01
    • 2020-03-29
    • 2013-11-24
    • 2018-01-27
    相关资源
    最近更新 更多