http://themorpheustech.com/test/test1.php
请转到链接。
菜单是固定位置,当你向下滚动它会显示,这正是我想要的。
您可以看到有很多菜单,Fixed menuWrapper 具有 100% 的宽度,而 Wrapper 内的 div 具有固定宽度(1240px),因为它有 19 个菜单。
好的,问题是当我在低分辨率监视器中看到该网站时:1024px 监视器,用于测试只需调整浏览器窗口的大小。一切正常,我的意思是固定的主菜单。但问题是它显示到菜单 18,并且浏览器窗口底部有一个水平滚动条,如果我滚动它,网站的内容会显示除菜单之外的所有内容?看到它显示到菜单 18。
我需要在 CSS 或 Jquery 中解决这个问题。
我使用的代码:
<style type="text/css">
html, body {
margin:0px;
padding:0px;
}
#menuWrapper {
position:fixed;
width:100%;
height:80px;
background-color:#999;
}
#menu {
position:relative;
width:1240px;
margin:0 auto;
height:80px;
white-space: nowrap;
}
#content {
padding-top:90px;
width:1240px;
background-color:#F3F3F3;
margin:0 auto;
}
</style>
<div id="menuWrapper">
<div id="menu">
Menu 1 |
Menu 2 |
Menu 3 |
Menu 4 |
Menu 5 |
Menu 6 |
Menu 7 |
Menu 8 |
Menu 9 |
Menu 10 |
Menu 11 |
Menu 12 |
Menu 13 |
Menu 14 |
Menu 15 |
Menu 16 |
Menu 17 |
Menu 18 |
Menu 19
</div>
</div>
<div id="content">
Website Content<br />
Website Content<br />
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>