2017-02-04 35 views
0

我想使用Bootstrap創建此佈局。它應該是有響應的。由於每個圖像使用不同的行,因此無法將事物置於原位。需要使用Bootstrap創建pic中顯示的佈局。如何放置所有的領域?

Image

我的代碼:https://jsfiddle.net/dxs2gdkg/

<!-- Page Content --> 
 
<div class="container"> 
 
    <div class="row"> 
 
     <div class="col-md-4 content-image"> 
 
      <img src="http://placehold.it/200x200"> 
 
     </div> 
 
     <div class="col-md-4"> 
 
      <h3>State of Texas Approved</h3> 
 
      <h2>Online Drivers Ed</h2> 
 
     </div> 
 
     <div class="col-md-4 featured-image"> 
 
      <img src="http://placehold.it/300x300"> 
 
     </div> 
 
    </div> 
 

 
    <div class="row"> 
 
     <div class=" col-md-12 main-list"> 
 
      <ul> 
 
       <li>America's #1 Driving School - Most Selected Course Provider</li> 
 
       <li>Save a trip to the DPS! Official test included in the Course</li> 
 
       <li>100% Pass Rate - Guaranteed to Pass the Official Test</li> 
 
       <li>Mobile, Tablet or Computer - Convenient, Self-Paced Course</li> 
 
      </ul> 
 
      <div class="small-images"> 
 
       <img src="http://placehold.it/200x100"> 
 
       <img src="http://placehold.it/200x100"> 
 
      </div> 
 
     </div> 
 
    </div>

+0

你的小提琴不包括任何Bootstrap CSS/JS文件。我更新了你的小提琴以包括他們。看到您更新的小提琴:https://jsfiddle.net/dxs2gdkg/1/ –

回答

0

你會需要一個行把所有的內容,把它分成兩列。左欄後也應該是一排又分成兩欄。

<div class="container"> 
      <div class="row"> 
       <div class="col-md-6"> 
        <div class="row"> 
         <div class="col-md-6"> 
          <img src="http://placehold.it/200x200" /> 
         </div> 
         <div class="col-md-6"> 
          <h3>State of Texas Approved</h3> 
          <h2>Online Drivers Ed</h2> 
         </div> 
        </div> 
        <div class="row"> 
         <div class="col-md-12"> 
          <ul> 
           <li>America's #1 Driving School - Most Selected Course Provider</li> 
           <li>Save a trip to the DPS! Official test included in the Course</li> 
           <li>100% Pass Rate - Guaranteed to Pass the Official Test</li> 
           <li>Mobile, Tablet or Computer - Convenient, Self-Paced Course</li> 
          </ul> 
          <div class="small-images"> 
           <img src="http://placehold.it/200x100"> 
           <img src="http://placehold.it/200x100"> 
          </div> 
         </div> 

        </div> 
       </div>  
       <div class="col-md-6"> 
        <img src="http://placehold.it/300x300" /> 
       </div>  
      </div>  
     </div> 
+0

感謝您的答覆。但我怎樣才能讓右側的大圖像適合整個專欄?目前它比列小,圖像右側留有空間。我也需要使大圖像的高度等於第一列的列高。大圖像應該出現在2個小圖像的底部附近。 – nsd

+0

https://jsfiddle.net/6kpp57e8/ – nsd

+0

這取決於你想如何放置你的img。最簡單的方法是將其應用爲背景圖像。但由於引導程序網格使用浮點數,因此即使高度設置爲%,某些內容仍在塊中時也不會顯示。所以這裏的訣竅是將另一個div作爲右列的子元素放置並像這樣填充底部。 [鏈接](http://codepen.io/blewherself/pen/PWavpo) – blewherself