为什么每个页面都会出现滚动条?
我在每一页上都有一个正文滚动条,它的滚动高度可能为 2em。即使在全屏 (1680x1050) 下,每个浏览器 IE、Chrome、Opera 和 FF 都会发生这种情况。
我不能简单地对正文执行“溢出:隐藏”,因为第三个测试页面使用 SlimBox2 可能需要向下滚动。
三个测试页:
http://dev.mykeepsakephotography.com
http://dev.mykeepsakephotography.com/gallery_ Couples.php
http://dev.mykeepsakephotography.com/invitations_weddings.php
body
{
font-family: Georgia, "Times New Roman", Times, serif;
background-color: #000;
color: #fff;
padding: 0;
margin: 0;
}
#wrapper
{
height: 725px;
width: 950px;
background: #000;
margin: 0 auto;
padding:0;
overflow: hidden;
border: 1px solid red; /* added for border definition */
}
谢谢,
低频4
I get a scrollbar for the body on every page and it scrolls maybe 2em in height. This is happening on every browser IE, Chrome, Opera, and FF even in full screen (1680x1050).
I can't simply do overflow:hidden for the body because of the third test page uses SlimBox2 might needs to scroll down.
Three test pages:
http://dev.mykeepsakephotography.com
http://dev.mykeepsakephotography.com/gallery_couples.php
http://dev.mykeepsakephotography.com/invitations_weddings.php
body
{
font-family: Georgia, "Times New Roman", Times, serif;
background-color: #000;
color: #fff;
padding: 0;
margin: 0;
}
#wrapper
{
height: 725px;
width: 950px;
background: #000;
margin: 0 auto;
padding:0;
overflow: hidden;
border: 1px solid red; /* added for border definition */
}
Thank you,
LF4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
导航中的 li.dir 导致滚动。删除它们就可以解决这个问题。
其中,
ul.dropdown ul
有一个导致问题的属性。这里的嵌套菜单导致元素出现在页面底部下方。解决这个问题,你的问题就成为历史了:)
在你的
ul.dropdown > 上抛出一个
选择器,一切都会工作得很好。position:relative;
。力> a, ul.dropdown li.dir {Position:absolute 会将其绝对定位到最近的带有position:relative 的父级,或者失败的话——文档本身。
The
li.dir
's within your nav are causing the scrolling. Removing them eliminates the issue.Within them, the
ul.dropdown ul
has an attributewhich is causing the issue. The nested menus here are causing elements to appear below the bottom of the page. Fix this and your problems are history :)
Throw a
position:relative;
on yourul.dropdown > li > a, ul.dropdown li.dir {
selector and everything will work splendidly.Position:absolute will position it absolutely to the nearest parent with position:relative, or failing that-- the document itself.
slimbox.css 有以下设置:
如果高度应为 725px,则与 #wrapper 相同。
The slimbox.css has the following settings:
I winder if height should be 725px, the same as #wrapper.