简体   繁体   中英

menu always on top and horizontal scroll

i have that trouble - http://pickup.eurocargo.fi/last500.php i need to do top menu what always on top, and the menu width can be 2x more than width of monitor. How is possbile do that top menu with horizontal scrolling?

Here is top menu css:

.visibleDiv, #topmenu
{

    position: fixed;
overflow: auto  ;
    width: 100%;
    border: solid 1px #e1e1e1;
    vertical-align: middle;
    background: #fff;
    text-align: center;
    top: 0px;
    left: 0px;
   padding-bottom:10px;
}

With the overflow tag i get to scrolls, 1 of page and 1 of the menu, i need to combine it to 1. If i use this css without overflow, then i get cutted topmenu.

Thank you!!

Have a look to this fiddle : http://jsfiddle.net/lulu3030/3sTWF/

The css :

html {
    height: 300%;
}

#menu-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    overflow: auto;
    border: solid 1px #e1e1e1;
    background: #eee;
    text-align: center;
    padding:10px;
}

#menu {
    width: 200%;
}

The HTML :

<div id="menu-container">
    <div id="menu">My menu here</div>
</div>

您仍然需要设置背景:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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