CSS。固定垂直div对齐

时间:2011-04-28 02:25:46

标签: css

如果不使用width: 270px;所有<div class="top-results">水平对齐,但我需要新行上的每个div。如何在css中替换width: 270px;

<div id="top-results-wrapper">
    <div class="top-results">
        <span class="top-results-number">208</span>
        <span class="top-results-car">BMW X6</span>
        <span class="top-results-result">13.552</span>
    </div>
    <div class="top-results">
        <span class="top-results-number">209</span>
        <span class="top-results-car">SUBARU IMPREZA</span>
        <span class="top-results-result">11.263</span>
    </div>
</div>

#top-results-wrapper {
    float: left;
    width: 270px;
}

1 个答案:

答案 0 :(得分:2)

此处,只需将.top-results设置为display:block

http://jsfiddle.net/samccone/46FyP/