CSS移动div问题
在我的网站 http://nebkat.com/beta/index.php 我添加了一个侧边栏。主页上有两个帖子。问题是第二个总是位于侧边栏内容下方。如何在不使用边距的情况下将其向上移动(示例:margin-top:-50px)
On my website http://nebkat.com/beta/index.php I added a sidebar. On the homepage there are two posts. The problem is that the second one always goes under the sidebar content. How do I move it up without using margins(example:margin-top: -50px)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
浮动您的
Float your <div id="content"> to the left? That works in FF 3
您的两个帖子之间有一个 style="clear: Both" 的 DIV。通过尝试,我删除了该 div 并将 style="clear: left" 添加到第二篇文章中。因此,也许可以尝试添加“clear: left;”到您用于帖子标题的 CSS 类。您分配给该 div 的类是 mainbar_header,因此您只需添加一个clear:left 即可。中间的 div 导致了间距问题,而不是侧边栏。
There is a DIV with style="clear: both" in between your two posts. By playing around, I deleted that div and added style="clear: left" to the second post. So, perhaps try adding "clear: left;" to a CSS class that you use for your post header. The class you are assigning to this div is mainbar_header so you could just add a clear:left to that. The div inbetween is causing the spacing issue, not the sidebar.