gpt4 book ai didi

javascript - 菜单总是在顶部和水平滚动

转载 作者:行者123 更新时间:2023-11-28 12:39:19 25 4
gpt4 key购买 nike

我有那个麻烦 - http://pickup.eurocargo.fi/last500.php我需要做总是在最上面的顶部菜单,菜单宽度可以是显示器宽度的 2 倍。水平滚动的顶部菜单如何实现?

这是顶部菜单的 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;
}

有了溢出标签,我可以滚动到页面的 1 个和菜单的 1 个,我需要将它合并为 1 个。如果我在没有溢出的情况下使用这个 css,那么我会被切掉 topmenu。

谢谢!!

最佳答案

看看这个 fiddle :http://jsfiddle.net/lulu3030/3sTWF/

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

HTML :

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

关于javascript - 菜单总是在顶部和水平滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17776808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com