How to Add a Doctype
The term doctype refers to the document type of an HTML page. Having a doctype is a requirement in order for your HTML page to be validated based on W3C (World Wide Web Consortium) standards. Various doctypes exist including HTML, XHTML, MathML, and Compound, which uses more than one doctype. Add a doctype either to an existing Web page or to a new document.
Instructions
-
-
1
Download the HTML page you want to add a doctype to using your FTP client software. Any FTP client software works, including Internet Explorer, FileZilla or Dreamweaver. The process to download via FTP differs depending on the software; refer to user manuals if you are unsure how to do this.
-
2
Right-click on the downloaded file. Select "Open With." Select your code-editing software to open the document. Notepad suffices for editing code if you do not have anything else.
-
-
3
Add the following code to the top of the page you just opened:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Your particular doctype might not be XHTML. Replace "xhtml, "xhtml1" and any other variations of "xhtml" with the proper doctype, or make sure your code is compliant with the "doctype" you chose.
-
4
Finish any additional editing necessary on the HTML document you are working on.
-
5
Save your HTML document and upload it to your website files using your FTP client software. Again, the process uploading via FTP differs based on the software being used.
-
1
Tips & Warnings
Standard available doctypes are as follows: HTML 4.01 Strict, HTML 4.01 Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1 DTD and XHTML Basic 1.1. XHTML Transitional is the most common doctype used.