如何强制div之外的文本到下一行?

时间:2012-07-01 21:45:07

标签: html css phpbb bbcode

使用开发跟踪器自定义PHPBB BBCode,但我遇到的问题是显示在模块旁边的文本而不是它下面。

EX:http://www.survivaloperations.net/viewtopic.php?f=2&t=4&p=5#p5 在第二篇文章。

我想在它下面的文本右侧默认。我试过了 display: block clear: both; adding a div surrounding the entire module with a width of 100%

但似乎都没有效果。

这是CSS:

.tracker_contain {
    margin: 0;
    padding: 0;
    min-width: 100%;
        clear: both;
}

#tracker_wrap {
    margin: 10px auto 0 auto;
    width: 515px;
    font-family:"Tahoma", Arial;
    font-size: 11px;
}
.tracker_top {
    padding: 8px 0 0 60px;
    background: url('http://www.survivaloperations.net/dev/images/tracker_top.png') no-repeat top;
    width: 455px;
    height: 22px;
    color: #525252;
    font-weight: bold;
    float: left;
}
.tracker_top a {
    font-weight: bold;
    text-decoration: none;
    color: #cb00cb;
}
.tracker_top a:hover {
    text-decoration: underline;
}
.tracker_body {
    padding: 10px 11px 10px 11px;
    background: url('http://www.survivaloperations.net/dev/images/tracker_bg.jpg') no-repeat top;
    width: 493px;
    color: #cb00cb;
    float: left;
}
.tracker_bottom {
    margin: 0;
    padding: 6px 11px 0 0;
    background: url('http://www.survivaloperations.net/dev/images/tracker_bottom.png') no-repeat bottom;
    width: 504px;
    height: 24px;
    text-align: right;
    color: #575757;
    float: left;
}
.tracker_bottom a {
    font-weight: bold;
    text-decoration: none;
        color: #575757;
}
.tracker_bottom a:hover {
    font-weight: bold;
    text-decoration: none;
    color: #000000;
}

这是HTML:

<div class="tracker_contain">
<div id="tracker_wrap">
<div class="tracker_top">Originally Posted By <a href="{URL}" alt="{URL}">{TEXT}</a></div>
<div class="tracker_body">
{TEXT}
</div>
<div class="tracker_bottom"><a href={URL}" alt="Read Post" target="_Blank">Original Post</a></div>
</div>
</div>

欢迎任何建议!

1 个答案:

答案 0 :(得分:1)

您的CSS包含

float: left

顶部,身体和底部。你必须摆脱它们。