2015-09-15 128 views
0

我有一個html引導程序文件,我試圖用custom.css做一些更改,但更改無效。例如,我不能更改標籤「h1」或類「carousel-inner」(我試圖將負邊距頂部消失在標頭和旋轉木馬之間的空間)。我無法在引導程序項目中編輯我的custom.css

這是我的html代碼:

<!DOCTYPE html> 
<html lang="en"> 

<head> 
    <meta charset="utf-8"> 
    <title>Bootstrap for Web Design</title> 
    <meta name="description" content="A Tuts+ course"> 

    <!-- Mobile Specific Meta --> 
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 

    <!-- Latest compiled and minified CSS --> 
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> 

    <!-- Custom CSS --> 
    <link rel="stylesheet" type="text/css" href="css/custom.css"> 

    </head> 
    <body> 
    <!-- Fixed navbar --> 
    <div class="navbar navbar-default navbar-static-top" role="navigation"> 
     <div class="container"> 
     <div class="navbar-header"> 
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 
      <span class="sr-only">Toggle navigation</span> 
      <span class="icon-bar"></span> 
      <span class="icon-bar"></span> 
      <span class="icon-bar"></span> 
      </button> 
      <a class="navbar-brand" href="#">SmartEvents</a> 
     </div> 
     <div class="navbar-collapse collapse"> 
      <ul class="nav navbar-nav navbar-right"> 
      <li class="active"><a href="#">Home</a></li>  
      <li><a href="#about">Criar evento</a></li> 
      <li class="dropdown"> 
       <a href="#" class="dropdown-toggle" data-toggle="dropdown">Registo <b class="caret"></b></a> 
       <ul class="dropdown-menu"> 
       <li class="dropdown-header">Admin & Dashboard</li> 
       <li><a href="#">Admin 1</a></li> 
       <li><a href="#">Admin 2</a></li> 
       <li class="divider"></li> 
       <li class="dropdown-header">Portfolio</li> 
       <li><a href="#">Portfolio 1</a></li> 
       <li><a href="#">Portfolio 2</a></li> 
       </ul> 
      </li>    
      <li><a href="#">Iniciar Sessão</a></li> 
      </ul> 
     </div><!--/.nav-collapse --> 
     </div> 
    </div> 



    <!-- Carousel 
    ================================================== --> 
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="3000"> 
    <!-- 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="images/slide1a.jpg" alt="..."> 
    <div class="carousel-caption"> 
       <h1>EVENTOS AO MINUTO</h1> 
       <h3>Compra e venda de bilhetes. Promoção de eventos.</h3> 
      <!-- <p><a class="btn btn-lg btn-primary" href="#" role="button">Criar evento</a></p>--> 
      </div> 
    </div> 
    <div class="item"> 
     <img src="images/slide2a.jpg" alt="..."> 
     <div class="carousel-caption"> 
      <h1>EVENTOS AO MINUTO</h1> 
       <h3>Compra e venda de bilhetes. Promoção de eventos.</h3> 
     </div> 
    </div> 
    <div class="item"> 
     <img src="images/slide3a.jpg" alt="..."> 
     <div class="carousel-caption"> 
      <h1>EVENTOS AO MINUTO</h1> 
       <h3>Compra e venda de bilhetes. Promoção de eventos.</h3> 
     </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> <!-- Carousel --> 


<div class="container"> 

    <!-- FOOTER --> 
    <footer> 
    <p class="pull-right"><a href="#">Back to top</a></p> 
    <p>This Bootstrap layout is compliments of Bootply. · <a href="http://www.bootply.com/108847">Edit on Bootply.com</a></p> 
    </footer> 

</div><!-- /.container --> 


    <!-- Latest compiled and minified JavaScript --> 
    <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> 
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> 

</body> 
</html> 

和我custom.css

@charset "UTF-8"; 
/* CSS Document */ 

.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { 
color: #000; /*Sets the text hover color on navbar*/ 
} 

.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > 
a:hover, .navbar-default .navbar-nav > .active > a:focus { 
color: white; /*BACKGROUND color for active*/ 
background-color: #030033; 
} 

    .navbar-default { 
    background-color: #333c4e; 
    border-color: #333c4e; 
} 

    .dropdown-menu > li > a:focus { 
    color: #41ae32; 
    text-decoration: none; 
    background-color: #41ae32; /*change color of links in drop down here*/ 
    } 


    .dropdown-menu > li > a:hover{ 
     background-color: #41ae32;  
     } 

.nav > li > a:hover, 
.nav > li > a:focus { 
    text-decoration: none; 
    background-color: silver; /*Change rollover cell color here*/ 
    } 


    .navbar-default .navbar-nav > li > a { 
    color: white; /*Change active text color here*/ 
    } 


<!--TEXTOS--> 
h1{ 
    font-size:40px; 
    color:#FFF; 
    background-color: forestgreen; 
} 



<!--Carousel--> 

.carousel-inner { 
    position: relative; 
    overflow: hidden; 
    width: 100%; 
    margin-top: -20px; 
} 

誰能幫助我? 非常感謝你

Paulo。

+0

你是什麼意思你「可以'編輯'它?就像您對css文件所做的更改不由服務器提供服務一樣? – tyler

+0

你確定你引用你的自定義ccs嗎?嘗試將bg顏色改爲藍色。也嘗試在私人會話中開放(隱身模式) – PolarisUser

+0

我無法看到我在h1或carousel-inner中所做的更改。例如,其他的變化,我可以看到。我怎樣才能使標題和旋轉木馬之間的空白消失? –

回答

0

您使用了錯誤的行註釋,

更改此:

<!--TEXTOS--> 
h1{ 
    font-size:40px; 
    color:#FFF; 
    background-color: forestgreen; 
} 



<!--Carousel--> 

.carousel-inner { 
    position: relative; 
    overflow: hidden; 
    width: 100%; 
    margin-top: -20px; 
} 

要這樣:

/*TEXTOS*/ 
h1{ 
    font-size:40px; 
    color:#FFF; 
    background-color: forestgreen; 
} 



/*Carousel*/ 

.carousel-inner { 
    position: relative; 
    overflow: hidden; 
    width: 100%; 
    margin-top: -20px; 
} 
+0

DUH !!!太多的工作時間..非常感謝你@亞當布坎南史密斯。 –

+0

@PauloFrutuoso沒問題:) –

+0

@PauloFrutuoso標記user2232273或我的回答正確,因此可以正確關閉。 –

0

刪除此評論

<!--TEXTOS-->

<!--Carousel-->。此語法用於html文件。要在CSS文件中發表評論,請使用:/* TEXTOS */

它應該工作。

這裏是一個DEMO

+0

DUH !!!太多的工作時間..非常感謝你:) –

相關問題