2016-05-17 100 views
0

我想給在HTML DIV內休息中的內容,但我沒有得到解決,請幫我找到解決辦法 這裏是我的html代碼如何打破div標籤

<div class="container"> 
     <div class="row"> 
      <div class="col-md-12"> 
       <div class="col-md-9"> 

        <h5>&nbsp&nbsp&nbsp&nbsp&nbsp Apartments</h5> 
        <hr> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0258.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8050.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0516.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8055.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0344.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8062.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_7784.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8073.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0501.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8082.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0213.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8104.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0334.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8393.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0466.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8473.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0406.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8498.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0329.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0138.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_7890.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0128.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0295.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0123.jpg');?>"></a></div> 
         <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0295.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0068.jpg');?>"></a></div> 
        <br/> 
         <h5>&nbsp&nbsp&nbsp&nbsp&nbsp Testimonials</h5> 
       </div> 
       <div class="col-md-3"> 
       </div> 
</div> 
</div> 
</div> 

我想在下一行H5標籤,但是當我加載頁面然後顯示到下一個圖像的

<h5>&nbsp&nbsp&nbsp&nbsp&nbsp Testimonials</h5> 

請幫我找到解決辦法

+1

在應用它們之前仔細閱讀bootstrap網格類,每個'.col - * - *'必須位於'row'或'container'裏面。 –

+0

所以問題是什麼。如何解決這個問題我想要打破 – nushrat

+0

默認情況下,所有標題標籤h1 ... h6都是塊元素,這意味着它們將始終在新行上呈現,除非在您的情況下使用引導程序網格類'col- *'等外部css使'h5'顯示爲內聯。 – dreamweiver

回答

2

總結所有col-* divsdivclass - row。你還可以使用text-centerclass類中可用的twitter bootstrap框架,而不是添加&nbsp;h5

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> 
 

 
<div class="container"> 
 
    <div class="row"> 
 
    <div class="col-md-12"> 
 
     <div class="col-md-9"> 
 

 
     <h5 class="text-center">Apartments</h5> 
 
     <hr> 
 
     <div class="row"> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0258.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8050.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0516.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8055.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0344.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8062.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_7784.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8073.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0501.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8082.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0213.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8104.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0334.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8393.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0466.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8473.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0406.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8498.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0329.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0138.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_7890.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0128.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0295.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0123.jpg');?>"></a> 
 
      </div> 
 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0295.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0068.jpg');?>"></a> 
 
      </div> 
 
      <br/> 
 
     </div> 
 
     <h5 class="text-center">Testimonials</h5> 
 
     </div> 
 
     <div class="col-md-3"> 
 
     </div> 
 
    </div> 
 
    </div> 
 
</div>

+0

引導程序在col-md-9之前需要col-md-12之後的另一個類行,或者更好的是使用class col-md-12刪除div,因爲這是無用的。 –

+0

如果您在'col-md-9'之後看到他有'col-md-3'的代碼。可能是OP與'col-md-12'有關,然後與3和9有關。所以它很好地給出OP想要的,而不是改變他的原始設計,除非我們知道它的好處.. :) @GermanoPlebani –

+0

Thanx很多rao .. – nushrat

0

簡單的解決方案是,你包圍在一排類圖像和H5的另一個排課。

這是在類col-md-9內創建2行,如下所示。

HTML代碼:

<div class="container"> 
    <div class="row"> 
     <div class="col-md-12"> 
      <div class="col-md-9"> 
       <div class="row"> 
       <h5>&nbsp&nbsp&nbsp&nbsp&nbsp Apartments</h5> 
       <hr> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0258.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8050.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0516.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8055.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0344.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8062.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_7784.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8073.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0501.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8082.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0213.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8104.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0334.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8393.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0466.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8473.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0406.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8498.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0329.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0138.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_7890.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0128.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0295.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0123.jpg');?>"></a></div> 
        <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0295.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_0068.jpg');?>"></a></div> 

      </div> 
      <div class="row"> 
        <h5>&nbsp&nbsp&nbsp&nbsp&nbsp Testimonials</h5> 
      </div> 
      </div> 
      <div class="col-md-3"> 
      </div> 

1

簡單的解決辦法是把圖象的div類行的div和然後提供

HTML CODE

<div class="container"> 
    <div class="row"> 
    <div class="col-md-12"> 
     <div class="col-md-9"> 

     <h5>Apartments</h5> 
     <hr> 
     <div class="row"> 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0258.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8050.jpg');?>"></a></div> 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0516.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8055.jpg');?>"></a></div> 
      <div class="col-lg-4 col-sm-4 col-xs-6"><a class="fancybox" title="Image 1" href="<?php echo base_url('assets/img/amen_LALCO_0344.jpg');?>"><img class="thumbnail img-responsive" src="<?php echo base_url('assets/img/gallery/LALCO_8062.jpg');?>"></a></div> 
      <br/> 
     </div> 
     <h5>Testimonials</h5> 
     </div> 
     <div class="col-md-3"> 
     </div> 
    </div> 
    </div> 
</div>