Specifying a doctype prevents the browser from switching to quirks mode, which can cause your page to render in unexpected ways.
How the Lighthouse doctype audit fails
Lighthouse flags pages without the
<!DOCTYPE html> declaration:
Each Best Practices audit is weighted equally in the Lighthouse Best Practices Score. Learn more in The Best Practices score.
How to add a doctype declaration
<!DOCTYPE html> declaration to the top of your HTML document:
See MDN's Doctype page for more information.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.