官术网_书友最值得收藏!

The <main> element

As per the Mozilla Developer Network (MDN) definition:

The HTML Main Element (<main>) can be used as a container for the dominant contents of the document. The main content area consists of content that is directly related to, or expands upon the central topic of a section or the central functionality of an application. This content should be unique to the document, excluding any content that is repeated across a set of documents such as sidebars, navigation links, copyright information, site logos, and search forms (unless, of course, the document's main function is as a search form). Unlike <article> and <section>, this element does not contribute to the document outline.

Here are a few important points to remember about the <main> element:

  • The top-level content of a page should be included in the <main> element.
  • The content should be exclusive and unique to it.
  • The <main> element should never be included inside the <header>, <footer>, <nav>, <aside>, or <article> elements.
  • There can only be one <main> element per page.

Consider the following example:

<body>
    <main class="main-container" role="main">Content goes here
    </main>
</body>

Tip

For good measure, use HTML entities for special characters, for example, the ampersand character (&) is &amp; and the ellipsis character (…) is &hellip;.

主站蜘蛛池模板: 榆社县| 泰州市| 峨眉山市| 游戏| 道孚县| 太仆寺旗| 辉县市| 自贡市| 崇信县| 滦平县| 阿克陶县| 廊坊市| 瑞丽市| 白银市| 辽源市| 南郑县| 拜泉县| 盘锦市| 寻乌县| 法库县| 大余县| 舟曲县| 灵台县| 福鼎市| 镇沅| 阆中市| 林甸县| 洛扎县| 乌拉特前旗| 神池县| 长顺县| 宿迁市| 屯留县| 灵山县| 五峰| 慈利县| 宝坻区| 广水市| 峨边| 临武县| 松潘县|