页面缺少 HTML 文档类型,因此触发了 Quirks 模式
指定文档类型可防止浏览器切换到 Quirks 模式,从而导致页面以意外方式呈现。
Lighthouse 文档类型审核为何失败
没有 <!DOCTYPE html>
声明的 Lighthouse 标记页面:
Each Best Practices audit is weighted equally in the Lighthouse Best Practices Score. Learn more in The Best Practices score.
如何添加文档类型声明
将 <!DOCTYPE html>
声明添加到 HTML 文档的顶部:
<!DOCTYPE html>
<html lang="en">
…
有关更多信息,请参阅 MDN 的 Doctype 页面。