CSS移动div问题

发布于 2024-09-02 04:20:25 字数 195 浏览 3 评论 0原文

在我的网站 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 技术交流群。

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

发布评论

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

评论(2

带刺的爱情 2024-09-09 04:20:25

浮动您的

向左转?这适用于 FF 3

Float your <div id="content"> to the left? That works in FF 3

墟烟 2024-09-09 04:20:25

您的两个帖子之间有一个 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.

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