我们可以在 HTML5 中使用 <main> 而不是 <div class="container"> 吗?

Can we use <main> instead of <div class="container"> in HTML5?

我是 HTML 的新手。我想知道它很好用 标记语义标签 而不是像 div class="main-content" 这样的东西?而且我还想知道语义标签和 div 元素的位置。

根据 W3Cmain 标签应仅用于该文档的唯一内容。

The <main> tag specifies the main content of a document.

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.

Note: There must not be more than one element in a document. The <main> element must NOT be a descendant of an <article>, <aside>, <footer>, <header>, or <nav> element.

更多html5标签你可以访问HTML5 Semantic Elements (W3Schools)