页脚定位问题
此处(在 Chrome 10 上)页脚似乎与侧边栏对齐(离右侧太远)而不是像它应该的那样居中。
我没有编辑页脚的 CSS。发生这种情况时,我正在编辑侧边栏和索引,但它距离页面太远,直到后来我才注意到,所以我不知道问题是什么。
欢迎任何建议!谢谢:)
Tara
更新:我已经检查了所有 DIV 是否正确关闭。侧边栏中缺少一些内容,解决了首页上的问题,但 不在子页面或文章上。现在顶部(菜单下方)出现一条黑线,似乎是#footer!!。我不明白为什么它在那里。
Here (on Chrome 10) the footer seems to be aligning with the side bar (too far to the right) instead of center like it's supposed to be.
I didn't edit the footer's CSS. I was editing the sidebar and the index when this happened, but it's so far down the page that I didn't notice 'til later, so I have no idea what the problem is.
Any suggestions welcome! Thank you :)
Tara
UPDATE: I've checked all the DIVs are correctly closing. Some were missing in the side bar, and that's fixed the problem on the front page but not on sub pages or articles. Now there is a black line appearing at the top (under the menu) that appears to be the #footer!!. I can't understand why it's there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的包装器
#casing
包含浮动元素,这些元素不会被清除以用于后续元素。这应该可以修复现代浏览器的问题。我推荐这篇文章,以便更好地理解和其他清算解决方案。
you wrapper
#casing
contains floated elements, which are not cleared for following elements.This should fix it for modern browsers. I recommend this article for better understanding and other clearing solutions.
您需要通过将
clear: left;
添加到#footer
css 来清除浮动元素。You need to clear your floated elements by adding
clear: left;
to your#footer
css.