简体   繁体   English

网页右侧出现奇怪的空白

[英]Strange Blank space appearing at right side of the web page

I am trying to build a web page which should appear same in both wide screen as well as in small screen monitors.我正在尝试构建一个网页,该网页在宽屏幕和小屏幕显示器中都应该显示相同。 I was trying to keep it fluid but in the mean time strange blank space appeared at the right side of the web page.我试图让它保持流畅,但与此同时,网页右侧出现了奇怪的空白区域。 Strange thing is the blank space is outside the viewport but it makes horizontal screen bar to appear and once scrolled to Right most side, one can see the white space.奇怪的是,空白区域在视口之外,但它使水平屏幕栏出现,一旦滚动到最右侧,就可以看到空白区域。 Code can be seen here http://jsfiddle.net/FW98q/代码可以在这里看到http://jsfiddle.net/FW98q/

MY gut feeling is the problem is at:我的直觉是问题在于:

 #Navigation_Container {

    background: #3399cc;
    height: 50px;
    //width: 960px;
    //margin: 0 auto;

}

Help is much appreciated.非常感谢帮助。

Also any tips on how to style the web page so that it remains consistent over screens.还有关于如何设置网页样式以使其在屏幕上保持一致的任何提示。 Comments on the design are also welcome..:)也欢迎对设计发表评论..:)

I found the issue....Its in the class '.notice' that is in the footer...if you remove我发现了这个问题......它在页脚中的“.notice”类中......如果你删除

position:absolute;

It works just fine.它工作得很好。 :) Check it out! :) 一探究竟! Fiddle小提琴

I used the element inspector in firefox at saw that it was the only element that was extending beyond the page.我在 Firefox 中使用了元素检查器,看到它是唯一扩展到页面之外的元素。

在此处输入图片说明

Also, if you need it positioned absolute on the bottom as you had it, make sure also put the left postion as well like this此外,如果您需要将它绝对放置在您拥有的底部,请确保也像这样放置左侧位置

position: absolute;
bottom: 0px;
left:0px;

Here is an example with the left:0px added这是添加了 left:0px 的示例

FIDDLE小提琴

#page_container, #Header {
    width: 960px;
}

Made sure these two element are the same width as the others if you want them to be the same width.如果您希望这两个元素的宽度相同,请确保这两个元素与其他元素的宽度相同。

// doesn't work in CSS and you aren't closing one of your divs. // 在 CSS 中不起作用,并且您没有关闭其中一个 div。 I think it's the content one.我认为这是内容之一。 Why do you have 3 different footer divs?为什么你有 3 个不同的页脚 div? Your mark up is way too complicated you could combine all three of those and get the same effect.您的标记太复杂了,您可以将所有这三个组合起来并获得相同的效果。

Taking that just out of the navigation container fixes the white space, but you've done it at least one other place.把它从导航容器中取出来修复空白,但你至少在另一个地方做了它。

添加到你的 css

body{margin:0;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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