How to use a doctype in HTML5

Contrary to previous HTML versions, the HTML5 doctype has been simplified to a large extent. As a first step a doctype needs to be clearly specified with !DOCTYPE, also referred to as the ‘Document Type Declaration’ (DTD). HTML5 nevertheless doesn’t necessarily need a DTD making !DOCTYPE rather abundant. Nonetheless it is advised to keep DTD and to clearly mark it as an html element, so !DOCTYPE html, which is placed at the top of the page. Please keep in mind !DOCTYPE is casesensitive.



Was this useful?