2014-10-11 152 views
3
<head> 
<title> 
    My Site 
</title> 
<style> 
    <link rel="stylesheet" type="text/css" href="design.css"> 
</style> 
</head>  

我找不出如何解決它。我的頁面完全不受樣式表影響。外部CSS樣式表不起作用。

回答

5

link不應放在style標記內。正確示例:

<head> 
<title> 
    My Site 
</title> 
<link rel="stylesheet" type="text/css" href="design.css"> 
</head> 
+0

哇,我覺得這麼愚蠢。謝謝!!! – CoenRox36 2014-10-11 09:50:39

2
<head> 
<title> 
    My Site 
</title> 
    <link rel="stylesheet" type="text/css" href="design.css"> 
</head> 

當你要鏈接外部樣式表不要使用風格,使用 風格,只有當你需要編寫HTML文檔本身的CSS。

欲瞭解更多信息:http://www.w3schools.com/css/css_howto.asp