I have a webpage that is HTML 4 transitional and HTML 5 compliant. In the latest version of the browsers is there a performance gain (decrease in the time to load/render the page) if I code the page to use the HTML5 DTD (which means don’t put a DTD) over the HTML 4 transitional DTD?
Share
The
DTDis just there to tell the browser (and a validator) what type of HTML you use and how your tags are deemed “valid”.A
DOCTYPEtells the browser what mode to use: strict or quirks mode which dictate how the browser should layout the page.HTML5 has the doctype
<!DOCTYPE html>– a DOCTYPE with no DTD.don’t confuse them, they are different things.
There is no performance gain to it as far as i know. However, using a
DOCTYPEmakes a browser layout the page in a standards-compliant (and a more consistent, but not totally) way across browsers. This is a “handsomeness” benefit rather than speed.