当页面上没有内容时,页脚就会上升。我在布局文件中的代码是这样的:

<div class="container-fluid">
  <div class="row-fluid">
     <!--<div class="span3">
      <div class="well sidebar-nav">
        <ul class="nav nav-list">
          <li class="nav-header">Sidebar</li>
            <li><%#= link_to "Link1", "/path1"  %></li>
            <li><%#= link_to "Link2", "/path2"  %></li>
            <li><%#= link_to "Link3", "/path3"  %></li>
        </ul>
      </div><!/.well -->
    <!-- </div> -->
    <div class="span9">
      <div id="alert">
          <% flash.each do |key, value| %>
         <%= content_tag :div, :id=>'flash_msg', :class => "alert alert-#{key}" do %>
         <%= value unless value.blank? %>
         <a class="close" data-dismiss="alert">×</a>
         <% flash.discard -%>
       <% end %>
      <% end %>
      </div>
      <%= yield %>
    </div>
  </div><!--/row-->
<footer class="footer-fix">
    <p>&copy; <%= Time.now.strftime("%Y") -%> Icicle Technologies Private Limited </p>
</footer>
</div> <!-- /container -->


当我将页脚放在容器流体类之外时,我也会遇到相同的问题。我可以在CSS中包含什么。有人能帮我吗?
对于页脚修复,css为:

.footer-fix{
    text-align: center;
}

最佳答案

采用
min-height属性which sets the minimum height of an element ..

.content-holder //whatever your div is
{
 min-height:500px;
}


JsFiddle:
http://jsfiddle.net/Cg9YZ/

希望这可以帮助。

10-07 19:46
查看更多