English 中文(简体)
页面布局问题
原标题:
  • 时间:2008-12-10 07:58:16
  •  标签:

Please let me know why there is lot of white space below the page content and also why horizontal scroll bar is displayed. Attaching link to zip folder below. Unzip and open index.html.
link text

最佳回答

第一个引导:

规则 div#content 在IE中几乎有效,在FireFox中会增加额外的宽度:

额外的宽度应用于您的

类。

div#content { margin: 3px 3px 3px 188px; background: rgb(255, 255, 255) none 
    repeat; min-height: 392px; }

中。

div#container { margin: auto; padding: 10px; background: rgb(255, 255, 255) 
   none repeat; position: relative; min-height: 400px; 
   max-width: 100%; min-width: 750px; }

水平滚动条显示的原因是内容右侧添加了188像素。当然,它们必须保留:不要移除它们。

在你的css规则中给

添加overflow:hidden

更普遍地说,您可能希望遵循“使用CSS进行渐进增强”最佳实践,并将CSS规则分为几个文件(直到实际部署到生产环境,您可以将所有CSS规则重新组合并压缩为一个紧凑的文件)。

问题回答

VonC is right. Add overflow: hidden; to div#container rule. Line 274 of index.css.

对于滚动条,VonC的建议是正确的,而页面内容下方的“很多空白空间”是由于你指定的最小高度。你可以使用属性“auto”来代替指定像素。

关于:“当我添加了overflow:auto;时,它在里面又生成了一组滚动条。”.. 为了解决这个问题,请在您使用的所有div中添加overflow:auto。





相关问题