2012-05-10 29 views
1

我試圖從CodeAcademy複製構建自己的簡歷項目,但是我在創建標題時遇到了一些麻煩。出於某種原因,它只會將我想要的背景顏色放在我的h1和h2標籤周圍,而不會放在我的dl標籤周圍。此外,我包含的twitter引導鏈接不起作用在我的頁面上。任何問題的任何幫助將不勝感激!Twitter Bootstrap和在CSS中格式化標題類

這裏是我的HTML:

<!DOCTYPE html> 
<html> 
    <head> 
    <title> 
     Parker Preyer's Resume 
    </title> 
    <link rel="stylesheet"href="style.css" /> 
    <link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" /> 
    </head> 
    <body> 
    <div class="header"> 
      <h1> 
          Parker J. Preyer 
         </h1> 
      <h2> 
          "I'm learning how to design websites!" 
         </h2> 

      <dl> 
      <dt> 
          Email 
         </dt> 
      <dd> 
          [email protected] 
         </dd> 

      <dt> 
          Phone 
         </dt> 
       <dd> 
          919-740-4206 
         </dd> 

      <dt> 
          Address 
         </dt> 
      <dd> 
          1042 Clay Street, San Francisco, CA 
         </dd> 
      </dl> 
    </div> 

    </body> 
</html> 



Here is my CSS: 


body, .details { 
    background: #ccc; 
} 

.header { 
    background: #222; 
    color: white; 
} 

dl dd { 
    color:white; 
} 

.header h1 { 
    font-size: 42px; 
} 

.header h2 { 
     font-family: "Georgia", Serif;  
     font-weight: normal; 
     font-style: italic; 
     color: #666; 
} 
+0

你想要什麼顏色在dl上? – frontendzzzguy

回答

2

首先,我想和你在你的CSS文件怎麼稱呼它應該這樣寫

<link rel="stylesheet" href="style.css" /> 
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" /> 

,而不是

<link rel="stylesheet"href="style.css" /> 
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" /> 

我開始然後通過執行以下操作將背景顏色添加到您的dl中

dl { 
    background: red; /* or whatever colour you need */ 
    }