Skip to content

[html] 第104天 说说HTML中的<html>标签有什么作用? #996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haizhilin2013 opened this issue Jul 28, 2019 · 6 comments
Open
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第104天 说说HTML中的<html>标签有什么作用?

@haizhilin2013 haizhilin2013 added the html html label Jul 28, 2019
@jacob-lcs
Copy link

<html> 元素定义了整个 HTML 文档。
这个元素拥有一个开始标签 <html>,以及一个结束标签 </html>,是为了告诉浏览器html从哪里开始,从哪里结束
元素内容是另一个 HTML 元素(body 元素)。

@nowherebutup
Copy link

  • 它告诉浏览器这是一个HTML文档
  • 它标识了文档开始和结束的位置
  • 它是最外层的标签

@LinStan
Copy link

LinStan commented Jul 29, 2019

供浏览器识别这是一个HTML文档
标识了HTML文档的头尾
是HTML文件的根元素
H5之后可以通过设置html的manifest属性来实现离线缓存
可以通过设置lang属性来设置页面的语言,常用的有zh和en

@dondonZh
Copy link

告诉浏览器这是 html文档按照html代码解析

@EragonBubble
Copy link

<html> 告知浏览器其自身是一个 HTML 文档。
<html> 与 </html> 标签限定了文档的开始点和结束点,在它们之间是文档的头部和主体。

@kruzabc
Copy link

kruzabc commented Jan 8, 2020

html 对应 js的 document.documentElement
head 对应 js的 document.head
body 对应 js的 document.body
所有的script 对应js的 document.scripts
所有的img 对应js的 document.imgs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html html
Projects
None yet
Development

No branches or pull requests

7 participants