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.
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:
"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">
"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:
"http://www.w3.org/TR/html4/frameset.dtd">
(使用Frame架構時使用)
(使用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:
DTD and any entity sets that are
needed. The following (relative) URIs refer to DTDs and entity
sets for HTML 4:
- "strict.dtd" -- default strict DTD
- "loose.dtd" -- loose DTD
- "frameset.dtd" -- DTD for frameset documents
- "HTMLlat1.ent" -- Latin-1 entities
- "HTMLsymbol.ent" -- Symbol entities
- "HTMLspecial.ent" -- Special entities
W3C文件
http://www.w3.org/TR/html401/struct/global.html
沒有留言:
張貼留言