0

我在我的 Rails 应用程序中使用 twitter-bootstrap

我正在关注本教程:http ://untame.net/2012/08/twitter-bootstrap-build-a-stunning-two-column-blog/

我有一个span 8带有span4小部件侧边栏 的相同主要元素

但由于某些原因,它看起来像这样:http ://s11.postimage.org/y2cf9wlrn/Bootstrap_Sidebar_fail.png

有谁知道发生了什么?我试图增加容器大小并降低主要元素跨度大小,但这无济于事

顺便说一句,该应用程序是响应式的

这是我的布局文件的外观

<div class="navbar navbar-inverse navbar-fixed-top">
  #navbar removed for clearer code
</div><!-- end of Navbar -->

<div class="container">

  <div id="myCarousel" class="carousel slide">
     #carousel removed for clearer code
  </div> <!-- Carousel items -->

<div id="user_nav" float="left">      
 #removed for clearer code
</div><!-- Flash messages-->

<div class="row">   
  <div class="span8">

    <div class="hero-unit">
      <!-- page specific content is loaded here -->
      <%= yield %>
    </div>

  </div><!-- end main area -->

  <aside class="span4"><!-- Sidebar starts here  -->    
    <div class="row">

        <div class="widget span4">
           #widget removed
        </div><!-- end widget -->

      </div><!-- end widget row -->
    </aside><!-- end sidebar -->
  </div><!-- end row -->
  #footer removed
</div><!-- end container -->
4

2 回答 2

1

it seemed like you had some opened div tags that werent closed.. so checking your source for that would help it as the layout you posted seems to be correct

于 2012-11-25T19:11:07.543 回答
0

你确定你的“.span8”和“.span4”元素在“.container > .row”里面吗?

<div class="container">
   <div class="row">
       <div class="span8">...</div>
       <div class="span4">...</div>
   </div>
</div>
于 2012-11-24T22:00:23.203 回答