这个问题在这里已经有了答案:
Purpose of the HTML5 main element
(3 个回答)
1年前关闭。
我对 main
有很多困惑HTML 的标签。它描述了页面的内容,body
也是如此。 .应该只有一个main
页面中的标签。 body
标签也应该在 HTML 中出现一次。这两个标签有什么区别? main
之间可以嵌套哪些元素标签,哪个不能?这个标签如何改变流动内容和明显内容的本质?
最佳答案
主体和主体的区别:
主要 :
The content inside the main element should be unique to the document. It should not contain any content that is repeated across documents such as sidebars, navigation links, copyright information, site logos, and search forms.
正文 :
The body element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc.
一个简单的例子,页脚元素;您应该将它放在主体内部,但在主体外部,就像您对菜单或侧边栏所做的那样。
关于html - HTML5 中的主要标签是什么?它与 body 标签有何不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56803764/