Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<!DOCTYPE html> and older browsers

Does <!DOCTYPE html> trigger standards mode for older browsers as well? Saying "in all modern browsers" isn't very precise.

I am especially interested in IE6.

Thank you.

like image 283
Francisc Avatar asked Mar 21 '11 22:03

Francisc


People also ask

Is HTML5 supported by all older browsers?

HTML5 is now compatible with all popular browsers (Chrome, Firefox, Safari, IE9, and Opera) and with the introduction of DOCTYPE, it is even possible to have a few HTML features in older versions of Internet Explorer too.

Is DOCTYPE HTML still required?

The HTML document type declaration, also known as DOCTYPE , is the first line of code required in every HTML or XHTML document. The DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in. This ensures that the web page is parsed the same way by different web browsers.

What happens if you dont write DOCTYPE HTML?

The absence of the DOCTYPE or its incorrect usage will force the browser to switch to quirks mode. It means that the browser will do its best to layout the page that is considered to be old or created against web standards.


1 Answers

This is how the HTML5 doctype came into existance (in layman's terms):

The guys who make the standards wanted a simpler doctype. They found out that <!DOCTYPE html> (which is as simple as it gets) does trigger standards mode in browsers. They decided to standardize it in HTML5.

True story.

like image 162
Šime Vidas Avatar answered Sep 21 '22 07:09

Šime Vidas