Skip to content

[html] 第66天 HTML5如果不写<! DOCTYPE html> ,页面还会正常工作么? #403

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第66天 HTML5如果不写<! DOCTYPE html> ,页面还会正常工作么?

Activity

wenyejie

wenyejie commented on Jun 21, 2019

@wenyejie

会啊! 只是有时候不是按照你想的那种情况来工作, 不过浏览器认为那是正常的
doctype就是声明文档类型, 它的影响范围包括HTML, CSS, DOM, 等
如果不声明文档类型, 浏览器就会按照自己的理解(规则)默认帮你声明一种类型. 具体看浏览器行为

yxkhaha

yxkhaha commented on Jun 21, 2019

@yxkhaha
  • 页面添加了<! DOCTYPE html>说明该页面采用了W3C标准,如果不加则页面会根据浏览器自身的解析标准来解析,这可能会导致页面在不同的浏览器呈现出不同的效果。
smile-2008

smile-2008 commented on Jan 6, 2021

@smile-2008
  • 页面添加了<! DOCTYPE html>说明该页面采用了W3C标准,如果不加则页面会根据浏览器自身的解析标准来解析,这可能会导致页面在不同的浏览器呈现出不同的效果。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @smile-2008@wenyejie@haizhilin2013@yxkhaha

        Issue actions

          [html] 第66天 HTML5如果不写`<! DOCTYPE html>` ,页面还会正常工作么? · Issue #403 · haizlin/fe-interview