0 votes
119 views
in HTML by (3.5k points)
edited

What are the different kinds of Doctypes available?

1 Answer

0 votes
by (3.5k points)
edited

A document type declaration or doctype is actually an instruction that conveys to the web browser what type of document it should expect.

The <!DOCTYPE> declaration is included at the start of each document it is added just above the <html> tag in each document.

The common doctype declaration for different version of HTML and XHTML are:

  1. For HTML 5 we simply write <!DOCTYPE html>
  2. HTML 4.01 Strict: The strict version of HTML 4.01 does not permit presentational to be written within HTML Elements. It also does not support inclusion of Frames.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>

  1. HTML 4.01 Transitional: The transitional version of HTML 4.01 this Transitional document type definition (DTD) allows users to utilize certain elements and attributes which were not allowed to be used in strict doctype.

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

http://www.w3.org/TR/html4/transitional.dtd”>

  1. HTML 4.01 Frameset: In HTML 4.01 version Frameset document type definition (DTD),allows users to use frames.

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

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

  1. XHTML 1.0 Strict: In XHTML 1.0 version Strict document type definition (DTD), does not support deprecated tags and the code must be written according to the XML Specification.

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

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

  1. XHTML 1.0 Transitional: In XHTML 1.0 version Transitional document type definition (DTD), allows deprecated elements.

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

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

  1. XHTML 1.0 Frameset: In XHTML 1.0 version Frameset document type definition (DTD), framesets are used.

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

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

  1. XHTML 1.1: In XHTML 1.1 version document type definition (DTD), allows the addition of modules

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

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

Related questions

0 votes
1 answer 128 views
0 votes
1 answer 72 views
0 votes
1 answer 87 views
asked Jun 10, 2022 in Discuss by Doubtly (98.9k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

537 users

...