2016-08-12 52 views
0

如何在引導程序中爲列div中的div設置保證金,就像在代碼中我試圖使保證金5px一樣,但它不起作用!如何在引導程序中爲列div中的div設置保證金

<div class="container bg_red">   
     <h1>Test DIV boxes</h1> 
     <div class="row"> 
      <div class="col-md-3 thin_border bg_green"> 
       <div class="bg_blue"> 
       Some content here for panel 1  
       </div> 
      </div> 
      <div class="col-md-9 thin_border"> 
       Some content here for panel 2 
      </div> 
     </div>      
    </div> 

回答

2

這是你想要的嗎?檢查margin-5類是添加到一個div而不是其他的,所以你可以看到差異。

.thin_border { 
 
    border: 1px solid #EFEFEF; 
 
} 
 
.margin-5{ 
 
    margin: 5px; 
 
}
<!-- Latest compiled and minified CSS --> 
 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
 
<div class="container bg_red"> 
 
    <h1>Test DIV boxes</h1> 
 
    <div class="row"> 
 
    <div class="col-md-3 thin_border bg_green"> 
 
     <div class="bg_blue margin-5"> 
 
     Some content here for panel 1 
 
     </div> 
 
    </div> 
 
    <div class="col-md-9 thin_border"> 
 
     Some content here for panel 2 
 
    </div> 
 
    </div> 
 
</div>

相關問題