2013-06-02 102 views
2

我有一個自舉網格系統的小問題。Bootstrap網格系統的問題

解釋我的問題有點困難,所以我添加了一張圖片來證明我的問題。這個問題發生在我添加第二行的圖片(當第一行是充滿

Image

我怎樣才能解決這個

我的代碼:?

<div class="row-fluid"> 
    <div class="span3"> 
     <div class="portfolio-thumb"> 
      <img src="http://dribbble.s3.amazonaws.com/users/29591/screenshots/1095922/flat_icons_1x.png"> 
     </div> 
    </div> 
    <div class="span3"> 
     <div class="portfolio-thumb"> 
      <img src="http://dribbble.s3.amazonaws.com/users/24078/screenshots/1096340/whale.jpg"> 
     </div> 
    </div> 
    <div class="span3"> 
     <div class="portfolio-thumb"> 
      <img src="http://dribbble.s3.amazonaws.com/users/141038/screenshots/1095723/cfrej_1x.png"> 
     </div> 
    </div> 
    <div class="span3"> 
     <div class="portfolio-thumb"> 
      <img src="http://dribbble.s3.amazonaws.com/users/86429/screenshots/1095840/happywoodcutter_ipad_sounas_1x.jpg"> 
     </div> 
    </div> 
    <div class="span3"> 
     <div class="portfolio-thumb"> 
      <img src="http://dribbble.s3.amazonaws.com/users/86429/screenshots/1095840/happywoodcutter_ipad_sounas_1x.jpg"> 
     </div> 
    </div> 
</div> 

回答

1

Bootstrap中的一行等於12列。您試圖在12列行中插入15列(5個div,每個跨越3列)。

這應該做的伎倆:

<!DOCTYPE HTML> 
<html> 
<head> 
<link rel="stylesheet" type ="text/css" href="bootstrap-responsive.min.css"> 
</head> 
<body> 
    <div class="row-fluid"> 
    <div class="portfolio-thumb span3"> 
    <img src="http://dribbble.s3.amazonaws.com/users/29591/screenshots/1095922/flat_icons_1x.png"> 
    </div> 
    <div class="portfolio-thumb span3"> 
    <img src="http://dribbble.s3.amazonaws.com/users/24078/screenshots/1096340/whale.jpg"> 
    </div> 
    <div class="portfolio-thumb span3"> 
    <img src="http://dribbble.s3.amazonaws.com/users/141038/screenshots/1095723/cfrej_1x.png"> 
    </div> 
    <div class="portfolio-thumb span3"> 
    <img src="http://dribbble.s3.amazonaws.com/users/86429/screenshots/1095840/happywoodcutter_ipad_sounas_1x.jpg"> 
    </div> 
    <div class="row-fluid"> 
    <div class="portfolio-thumb span3"> 
    <img src="http://dribbble.s3.amazonaws.com/users/86429/screenshots/1095840/happywoodcutter_ipad_sounas_1x.jpg"> 
    </div> 
    </div> 
    </body> 
    </html> 
+0

謝謝!精彩:) – kanarifugl

3

退房http://twitter.github.io/bootstrap/scaffolding.html

基本上,Bootstrap的網格系統是基於12列的,每個<div class="row-fluid">應該表示發送一行而不溢出到下一行。所以你的標記問題是你一行有15列。

您可以通過關閉row-fluid div並在第4張圖像後打開一個新圖像(12列 - 4次span3)來修復它。