Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does a Web browser differentiate between HTML5 and HTML4?

How does a Web browser differentiate between HTML5 and HTML4?

like image 671
AHméd Net Avatar asked Oct 27 '14 22:10

AHméd Net


People also ask

What is the difference between HTML4 doctype and HTML5 doctype?

DOCTYPE for HTML4 is much longer as it is SGML-based. However, the reference to DTD has been withdrawn from HTML5 <! DOCTYPE> declaration, since it is not based on SGML. Therefore, there is no need to tell the browser about Type Definition of Document and with HTML5 a simple <!


1 Answers

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">  
like image 124
dokaspar Avatar answered Sep 25 '22 17:09

dokaspar