2

我很努力地學習如何使用Bootstrap 3正確地排列事情。當列包裝時,我希望它滾動到底部最後一個div。Bootstrap 3 - 列包裝 - 佔用列中的可用空間

很多時候,我會有一個超出主體長度的邊欄。側欄中的信息比主框更重要,但比底部的信息更重要。

如何在下面的示例中獲得兩個綠色部分以排列在更大的屏幕上?

查看示例代碼 - http://www.bootply.com/42XM6PGoDS

.example{ 
 
    background-color: green; 
 
    min-height:200px 
 
     
 
    } 
 
    
 
.example2{ 
 
    background-color: red; 
 
    min-height:500px; 
 
}
<div class="container"> 
 
    <div class="row"> 
 
    <div class="col-lg-8"> 
 
     <div class="example"> 
 
     Main Body of Information 
 
     </div> 
 
    </div> 
 
    <div class="col-lg-4"> 
 
     <div class="example2"> 
 
     Important information on sidebar when on a large screen 
 
     </div> 
 
    </div> 
 
    <div class="col-lg-8"> 
 
     <div class="example"> 
 
     Less important information 
 
     </div> 
 
    </div> 
 
    </div> 
 
</div>

回答

0

一種方法是簡單地在側邊欄使用pull-right ..

​​

http://bootply.com/IGLRYDnc2S

+0

這是我結束了自己,它產生了我想要在一個更大的屏幕上,但現在如果你在一個較小的屏幕上,該列將不再重新調整大小。這在示例中是可見的。 – 2015-03-31 19:23:13

0

什麼2列(如同事-9和同事 -3)創建你的主頁的地方col-3用於側邊欄。然後你在主頁添加一切都不會有你在談論的差距...

例如:

<div class="row"> 
    <div class="col-sm-9"> 
     <!-- Main page content here --> 
    </div> 
    <div class="col-sm-3"> 
     <!-- Sidebar content here --> 
    </div> 
</div> 
+0

的順序,他們在當在手機上是很重要的。這將需要: 綠色 紅 綠色 添加兩列,如果我沒有記錯的話,將與綠色綠色紅色結束 – 2015-03-31 19:01:45

+0

是我不好,我想不出任何東西把我的頭在頂部爲了做到這一點沒有JavaScript ... – ganders 2015-03-31 19:04:39

+0

沒問題,我很難過自己。這似乎應該是可能的。如果我用右拉浮動較小的列,我可以在大屏幕上獲得正確的效果。但是,如果窗口重新調整大小,它不會作出響應性更改。 – 2015-03-31 19:12:12

相關問題