HTML Doc Type

HTML Doc Types

When you build a website, it has a DTD at the top of the page which declares the type of document for the web page. These days, most web pages use various declarations for html and xhtml. Below, are two code samples for the most common types of xhtml documents and the html 5 document. Aside from the DTD, the html, body and head tags are the same.

XHTML Transitional Sample

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">  <html xmlns="" xml:lang="en-gb" lang="en-gb" > <head></head> <body> </body> </html> 

XHTML 5 Sample

 <!DOCTYPE HTML> <html> <head></head> <body> </body> </html>