雖然我訪問過這個網站很多次,這是我的第一個問題。CSS沒有鏈接到xHTML
經過幾個小時的谷歌美孚無濟於事,我無法讓我的樣式錶鏈接。
<!DOCTYPE html PUBLIC 「-//W3C//DTD XHTML 1.0 Strict//EN」 「http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd」>
<html xmlns=」http://www.w3.org/1999/xhtml」 lang=」en」 xml:lang=」en」>
<head>
<title>Newb Development</title>
<link type=「text/css」 rel="stylesheet" href=」\master.css」 />
</head>
<body>
<img src="banner.gif" alt="NewbDev Logo" title="Newb Development" />
<h1>Welcome To NewbDev.com</h1>
<h2>Under Construction</h2>
<p>
As you can see, we are currently under construction. Upon completion
of the website you will be able to follow a fellow newb developer
on his journey to <em>programming masterification!</em>
</p>
</body>
文件 「master.css」 是在同一目錄下。我已經在計算機上通過服務器嘗試過了,而且我的樣式不適用。我知道我不需要在這裏發佈樣式表,但它沒什麼特別,我非常樂觀,樣式表的內容不是問題。
css文件是否確實位於您的域的根目錄中的該位置?當你使用HTML而不是XHTML時,它是否正確?我們可以看到你的網站嗎? – 2012-03-25 16:56:57
你在那裏有一些時髦的語音標記字符,不知道這是否會有問題。否則,嘗試使用正斜槓的路徑(假設您的css文件位於Web根目錄)'href =「/ master.css」' – shanethehat 2012-03-25 16:57:41
如果您從鏈接href中移動「\」(確保主站。 css是在同一個目錄下有html文件的)? – Steve 2012-03-25 16:58:37