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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With