What would happen if the HTML Document does not contain <!DOCTYPE>?

Submitted 3 years, 5 months ago
Ticket #271
Views 550
Language/Framework Html
Priority Low
Status Closed

and What are the different kinds of Doctypes available?

Submitted on Oct 28, 20
add a comment

1 Answer

Verified

The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the tag.

The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.

<!DOCTYPE  html> // Tells the browser that we are using HTML5.

new  features  & tags in HTML5 such as <article>,< footer >, <header>,<nav>, <section> may not be supported if the <!DOCTYPE> is not declared.

Additionally, the browser may decide to automatically go into Quirks or Strict Mode.

Types of HTML DOCTYPES:

HTML5 and beyond

<!DOCTYPE  HTML>

HTML 4.01

Strict

<!DOCTYPE  HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

   "http://www.w3.org/TR/html4/strict.dtd">

Transitional

<!DOCTYPE  HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

   "http://www.w3.org/TR/html4/loose.dtd">

Frameset

<!DOCTYPE  HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"

   "http://www.w3.org/TR/html4/frameset.dtd">

XHTML 1.0

Strict (quick reference)

<!DOCTYPE  html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Transitional

<!DOCTYPE  html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Frameset

<!DOCTYPE  html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML 1.1 - DTD:

<!DOCTYPE  html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

               

XHTML Basic 1.1 (quick reference):

<!DOCTYPE  html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"

    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">

Historical doctype declarations

HTML 2.0 - DTD:

<!DOCTYPE  html PUBLIC "-//IETF//DTD HTML 2.0//EN">

HTML 3.2 - DTD:

<!DOCTYPE  html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

XHTML Basic 1.0 - DTD:

<!DOCTYPE  html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"

    "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">

Submitted 3 years, 5 months ago


Latest Blogs