6

How does a Web browser differentiate between HTML5 and HTML4?

dokaspar
  • 8,186
  • 14
  • 70
  • 98
AHmedRef
  • 2,555
  • 12
  • 43
  • 75

1 Answers1

4

According to w3schools, the following DOCTYPE defines a document as HTML5:

<!DOCTYPE html>

And the three types of HTML4 are defined by the following DOCTYPE declarations:

HTML 4.01 Strict

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

HTML 4.01 Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">  
dokaspar
  • 8,186
  • 14
  • 70
  • 98