2017-02-18 182 views
0

這有什麼錯我的CSS:文本不居中因爲我希望CSS的text-align不起作用

看到https://jsfiddle.net/L5bgrg8d/

<html> 
    <head> 
    <title> 

    </title> 
    <link rel="stylesheet" href="style.css"> 
    </head> 
    <body> 
    <div id="container"> 
     <div id="header"> 
     My header 
     </div> 
     <div id="content"> 
     <div id="nav"></div> 
     </div> 
     <div id="footer"></div> 
    </div> 
    </body> 
</html> 

的style.css

#header { 
    background-color: teal; 
    color: white 
    text-align: center; 
} 
+1

忘了分號顏色後':white' –

回答

2

在CSS你錯過了分號。

#header { 
    background-color: teal; 
    color: white; 
    text-align: center; 
} 
+0

哦,謝謝,我一直是壞的語法:(會將您的anwser爲正確的幾分鐘(需要等待) – user310291

+0

大多數Welocome ... – KiranPurbey