2011年11月30日 星期三

HTML學習三:版本資訊

資料內容皆是W3C釋出文件
2.HTML的版本資訊(HTML version information)
HTML 4.01 specifies three DTDs, so authors must include one of the following
document type declarations in their documents. The DTDs vary in the elements
they support.

DTD(Document Type Definition):文件類型定義,用來檢驗文件上文法是否正確。

DOCTYPE的宣告可以使用以下三種:
  • The HTML 4.01 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents. For documents that use this DTD, use this document type declaration:
         <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
         "http://www.w3.org/TR/html4/strict.dtd">

         (嚴格模式)
  • The HTML 4.01 Transitional DTD includes everything in the strict DTD plus deprecated elements and attributes (most of which concern visual presentation). For documents that use this DTD, use this document type declaration:
       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
        (寬鬆的,過渡期的,一般皆使用這個宣告,可以有較好的相容性)
  • The HTML 4.01 Frameset DTD includes everything in the transitional DTD plus frames as well. For documents that use this DTD, use this document type declaration:
       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
        "http://www.w3.org/TR/html4/frameset.dtd">
       (使用Frame架構時使用)



The URI in each document type declaration allows user agents to download the
DTD and any entity sets that are
needed. The following (relative) URIs refer to DTDs and entity
sets
for HTML 4:
參考資料
W3C文件
http://www.w3.org/TR/html401/struct/global.html

沒有留言:

張貼留言