How to Use a Document Type Declaration
The syntax for a DOCTYPE is: The Doctype is the only XHTML element that is required to have uppercase letters, an exclamation mark, and it is the only tag that is not closed., Decide which DOCTYPE you will use for your document., Add the DOCTYPE you...
Step-by-Step Guide
-
Step 1: The syntax for a DOCTYPE is: <!DOCTYPE html PUBLIC "(Document Type)" "(URL)"> The Doctype is the only XHTML element that is required to have uppercase letters
XHTML
1.1 is a newer version of XHTML, but it should be avoided because there may be compatibility issues with older browsers.<!DOCTYPE html PUBLIC "- XHTML
1.0 Strict is used for web pages using valid XHTML.<!DOCTYPE html PUBLIC "- Use XHTML
1.0 Transitional if you expect users to use older browsers.
You can use presentation elements (such as the <font> tag) from older versions of HTML 4 that may display better on older browsers but can reduce the efficiency and accessibility of documents.<!DOCTYPE html PUBLIC "- XHTML
1.0 Frameset is used in documents using frames.<!DOCTYPE html PUBLIC "- HTML
4.01 should no longer be used and is being replaced with XHTML.
Use one of the XHTML declarations instead.<!DOCTYPE html PUBLIC "- , -
Step 2: an exclamation mark
-
Step 3: and it is the only tag that is not closed.
-
Step 4: Decide which DOCTYPE you will use for your document.
-
Step 5: Add the DOCTYPE you chose as the first line at the top of each XHTML document of your website.
Detailed Guide
XHTML
1.1 is a newer version of XHTML, but it should be avoided because there may be compatibility issues with older browsers.<!DOCTYPE html PUBLIC "- XHTML
1.0 Strict is used for web pages using valid XHTML.<!DOCTYPE html PUBLIC "- Use XHTML
1.0 Transitional if you expect users to use older browsers.
You can use presentation elements (such as the <font> tag) from older versions of HTML 4 that may display better on older browsers but can reduce the efficiency and accessibility of documents.<!DOCTYPE html PUBLIC "- XHTML
1.0 Frameset is used in documents using frames.<!DOCTYPE html PUBLIC "- HTML
4.01 should no longer be used and is being replaced with XHTML.
Use one of the XHTML declarations instead.<!DOCTYPE html PUBLIC "- ,
About the Author
Grace Phillips
Committed to making creative arts accessible and understandable for everyone.
Rate This Guide
How helpful was this guide? Click to rate: