-1

这是我的示例视图

<style>.listing{float: left}</style>

<div class="listing left-most">
    <div class="col1">dynamically loaded by rails loop</div>
    <div class="col2">dynamically loaded by rails loop</div>
</div>

<div class="listing">
    <div class="col1">dynamically loaded by rails loop</div>
    <div class="col2">dynamically loaded by rails loop</div>
</div>

<div class="listing">
    <div class="col1">dynamically loaded by rails loop</div>
    <div class="col2">dynamically loaded by rails loop</div>
</div>

例如:共有 3 个帖子和 6 个评论。需要垂直显示而不是水平显示

是否可以使用 rails loop 垂直显示?是的,我怎样才能实现它。能表示

编辑 1

在此处输入图像描述

\

我怎样才能通过轨道循环实现类似的设计。标题和列表都将是数据库中的动态。

4

1 回答 1

0

Yes, get rid of float:left. Why did you include it? The purpose of that rule is to stop things from displaying vertically. The default behaviour for block-level elements, which all of your elements are, is to stack vertically. The CSS you've added explicitly defeats this default behaviour.

于 2013-09-10T18:38:57.063 回答