2014-11-06 53 views
1

我在我的single.php頁面有一個WordPress主題。下面遵循HTML代碼:如何使用Bootstrap clearfix清除浮點數?

<div class="container"> 
    <div class="row"> 

     <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12"> 
      <div id="single-post"> 
       single post content 
      </div> 
     </div> 

     <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12"> 
      <div id="sidebar-area"> 
       sidebar area 
      </div> 
     </div> 

    </div> 
</div> 

CSS代碼:

#single-post, 
#sidebar-area { 
    margin:10px auto; 
    background: #fff; 
    border: 1px solid #d7d7d7; 
    padding: 15px; 
} 

圖像呈現

enter image description here

當我的一個帖子的內容高度比側欄區域較短,一些側邊欄小部件將轉到單個內容區域下。 如何通過使用Bootstrap clearfix類來顯示側邊欄區域中的所有側邊欄小部件?

+0

使用引導電網,使您投入4山坳格將在這裏和8(左任何內容)和4(邊欄)collums的div和一切都無所謂了多久會你的側邊欄。也許我只是不明白你的問題 - 對不起 - 但爲什麼你想使用clearfix? – Northys 2014-11-06 23:40:31

+0

簡單的例子,應該幫助你 - 如果我瞭解你http://www.bootply.com/teLpSeImf6 – Northys 2014-11-06 23:46:34

回答

1

謝謝你的答覆我,但我的問題也就迎刃而解了 我用這個網格下面我的側邊欄小工具中,因爲重複每小部件,我刪除了代碼和sidebar.php文件中粘貼,我的問題解決了,並顯示所有小工具在側欄區域

<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12"> 
</div>