流体布局中不需要的水平滚动条

发布于 2024-09-13 22:42:26 字数 290 浏览 9 评论 0原文

http://www.two Five Five Five.com/asctest/

我正在帮助一位朋友处理此网站,它是一个流畅的、基于%的设计(我没有使用它的经验)。

由于某种原因,我得到一个水平滚动条,它滚动到右侧的空白区域。我完全不知道是什么导致页面比应有的更宽,我已经三次检查了代码,一切似乎都按顺序进行;我越来越绝望了!

任何帮助将不胜感激。

http://www.twofivefivefive.com/asctest/

I am helping a friend with this site, and it is a fluid, % based design (which I have no experience working with).

For some reason, I am getting a horizontal scroll bar, that scrolls into blank space on the right side. I haven't the faintest clue what is causing the page to be wider than it should be, I've triple checked the code and everything seems to be in order; I am getting desperate!

Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

是伱的 2024-09-20 22:42:26

全部都在

如果你设置“margin-left”而不是“left”,元素将有左边距,但不会向右推,因为“left”仍然位于容器的左边缘(所以 div#topTitle 应该有margin-left: 270px; 设置并且没有设置“left”属性,div#topNav 应该设置 margin-left: 281px; (261px 从“left”属性和额外的 20px 已设置为 margin-left),没有“left”属性。

It's all inside the <div id="header">. The <div id="topTitle"> and the <div id="topNav"> both have the CSS "position" property set to "relative" and then the "left" property to give it an offset from the left side of the page. However, the element maintains its same width (100%) and is pushed off to the right side.

If you set "margin-left" instead of "left", the elements will have a left margin but will not push off towards the right because the "left" is still at the left edge of the container (so div#topTitle should have margin-left: 270px; set and not have the "left" property set and div#topNav should have margin-left: 281px; set (261px "migrated" from the "left" property and an extra 20px that was already set as margin-left) with no "left" property.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文