2014-07-22 40 views
0

如何通過引導程序或CSS自定義傳送帶的寬度?自定義傳送帶寬度的自定義

我目前主要使用此代碼到我的網頁:

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> 
    <!-- Indicators --> 
    <ol class="carousel-indicators"> 
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> 
    <li data-target="#carousel-example-generic" data-slide-to="1"></li> 
    <li data-target="#carousel-example-generic" data-slide-to="2"></li> 
    </ol> 

    <!-- Wrapper for slides --> 
    <div class="carousel-inner"> 
    <div class="item active"> 
     <img src="..." alt="..."> 
     <div class="carousel-caption"> 
     ... 
     </div> 
    </div> 
    <div class="item"> 
     <img src="..." alt="..."> 
     <div class="carousel-caption"> 
     ... 
     </div> 
    </div> 
    ... 
    </div> 

    <!-- Controls --> 
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> 
    <span class="glyphicon glyphicon-chevron-left"></span> 
    </a> 
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> 
    <span class="glyphicon glyphicon-chevron-right"></span> 
    </a> 
</div> 

我試圖寬度設置爲體,但它是行不通的。

在此先感謝!

+0

如果你可以提供一個鏈接到你的項目 – JoJo

+0

你的CSS在哪裏? – Aibrean

+0

@Aibrean,它只是引導 – user3818045

回答

1

您有2個選項設定轉盤的寬度

  1. 集容器寬度,幷包括在該容器圓盤傳送帶,該寬度可以被定製爲

    .container { 
        width : // here enter your custom width 
    } 
    

覆蓋此過默認bootstrap css/less。不要忘記添加媒體查詢來調整寬度,因爲這將適用於全局。

  • 其次可以更改轉盤物品的內部寬度與類,如下

    .carousel-inner { 
        width: // here enter your custom width; 
    } 
    
  • 這將只是影響傳送帶的寬度

    +0

    在bootstrap css文件後輸入你的自定義css – BK004

    0

    寬度是相到傳送帶所在的父容器。因此,您需要在包裝傳送帶的div的ID /類中設置寬度。您也可以將它設置在引導程序容器內(並全局更改容器寬度)或列內部以獲得更寬鬆的特定性。