2013-10-16 20 views
0
<html> 
    <head> 
     <title>Homepage</title> 

     <style type="type/css"> 
     body { 
      font-family: Arial; 
      color:#FFFFFF; 
      background-attachment:fixed; 
     } 
     h1 { 
      font-family:Arial; 
      font-size:49px; 
     } 
     h2 { 
      font-family:Papyrus, Times New Roman; 
     } 
     h3 { 
      font-family:Times New Roman: 
     } 
     </style> 
    </head> 

這是我如何寫頭。我的網站沒有做任何風格。這段代碼有什麼問題嗎?當我把它放在瀏覽器中並查看源代碼時,它並不顯示body,h1,h2,h3和標籤看起來像純文本。我怎樣才能解決這個問題。在記事本中創建網站。有麻煩

+0

檢查瀏覽器的Web控制檯(例如,Firefox中的shift-ctrl-k)。它會顯示你的代碼造成的任何錯誤(例如錯誤的css指令) –

+0

發佈你的HTML代碼 –

+0

有沒有'body'? –

回答

1

樣式類型應該是「text/css」而不是「type/css」,儘管你真的不需要它。

<head> 
     <title>Homepage</title> 

     <style type="text/css"> 
      body { 
       font-family: Arial; 
       color:#FFFFFF; 
       background-attachment:fixed; 
      } 
      h1 { 
       font-family:Arial; 
       font-size:49px; 
      } 
      h2 { 
       font-family:Papyrus, Times New Roman; 
      } 
      h3 { 
       font-family:Times New Roman: 
      } 
     </style> 
    </head> 
0
font-family:Times New Roman: 

應該

font-family:Times New Roman; 

在一個側面說明...看看記事本++

;不是: