【问题标题】:Align Bootstrap content to the right of an image within a thumbnail将 Bootstrap 内容与缩略图中图像的右侧对齐
【发布时间】:2012-12-29 21:14:22
【问题描述】:

我无法在引导缩略图中将标题与图像右侧对齐

我的 HTML

  <div class="container">
   <div class="row">
    <div class="span8 offset2">
     <% @response.each do |f| %>
     <% f.each_pair do |k, v| %>
     <h3 class="smallTitle">Available on&nbsp;<%= k %></h2>
      <% v.each do |film| %>

     <div class="thumbnail">
      <img src="http://placehold.it/180x200">
       <div class="caption">
        <%= link_to film[1], film[0] %> : <%= link_to "remind me", "#", :class => 'remind' %>
       </div>
      </div>
     <% end %>
    <% end %>
   <% end %>
  </div>
 </div><!--Row-->
</div><!--/container-->

所以目前我的图像在左侧,而标题在图像下方.. 有没有一种简单的 css 方法可以让 div 的标题位于图像的右侧

【问题讨论】:

    标签: css ruby-on-rails twitter-bootstrap


    【解决方案1】:

    您可以在缩略图 div 中浮动图像和标题

     <div class="thumbnail clearfix">
      <img src="http://placehold.it/180x200" class="pull-left">
       <div class="caption" class="pull-right">
        <%= link_to film[1], film[0] %> : <%= link_to "remind me", "#", :class => 'remind' %>
       </div>
      </div>
    

    【讨论】:

      猜你喜欢
      • 2011-01-25
      • 2020-10-17
      • 1970-01-01
      • 2016-07-11
      • 2020-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多