小编Rut*_*son的帖子

Twitter Bootstrap缩略图标题右侧

如何将Twitter Bootstrap缩略图的标题放在图像的右侧而不是下方?最好是在CSS中.到目前为止,我只使用现有标签,因为我的css知识非常有限.

<ul class="thumbnails">
  <li class="span2">
    <div class="thumbnail span4">
  <div class="span2">
        <img src="http://placehold.it/120x160" alt="">
      </div>
      <div class="caption">
        <h5>Thumbnail label </h5>
        <p>Cras justo odio, dapibus ac facilisis in, egestas eget. Eget metus</p>
        <p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
      </div>
    </div>
  </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

css thumbnails caption twitter-bootstrap

12
推荐指数
1
解决办法
3万
查看次数

具有奇怪值的ruby数组

为什么下面的代码将我的@groups数组设置为:

@groups=[[[24, 25, 26], [27, 28, 29], [30, 31, 32], [33, 34, 35]], [[24, 25, 26], [27, 28, 29], [30, 31, 32], [33, 34, 35]], [[24, 25, 26], [27, 28, 29], [30, 31, 32], [33, 34, 35]]]

@ groups.inspect显示了上面的奇怪内容:为什么?下面代码中的puts语句显示了预期0..35.@groups与启动nil此代码启动时的所有元素.

class Os_tasks

  def set_n_tasks(n)
    @n_tasks=n
  end

  def set_n_events(n)
    @n_events=n
  end


  def create_group_sizes
    @n_groups=@n_tasks / @n_events
    even=@n_groups*@n_events
    n_expanded_groups=@n_tasks-even
    @group_sizes = []

    added_groups=n_expanded_groups
    (0..@n_groups-1).each do

      x=0
      if added_groups > 0
        x=1
        added_groups=added_groups-1
      end

      x=x+@n_events

      @group_sizes << x …
Run Code Online (Sandbox Code Playgroud)

ruby arrays loops

4
推荐指数
1
解决办法
122
查看次数

标签 统计

arrays ×1

caption ×1

css ×1

loops ×1

ruby ×1

thumbnails ×1

twitter-bootstrap ×1