W3C specification
The main purpose of
The main content of a document or application. The main content area consists of content that directly relates to or extends to the central topic of the document or the core functionality of the app.
Since the
The body element represents the content of the document.
Details
One thing to note about using the
According to the specification, if you try to use multiple
Another requirement for the
Use
Just like other new HTML5 elements, not all browsers can recognize
main {display:block;}
Sometimes, in order to support some lower versions of IE browsers, you may also need to use JavaScript to create this element.
<script type="text/javascript">document.createElement('main');</script>
Of course, you can also use html5shiv.
The easiest way to use the So, what should it look like in practice? Below is the structure of the document before using the The following uses the Okay, this is so simple that in less than a minute we can rewrite the document into the latest HTML5 style. Summary As you can see, using the The above is the content of HTML5 semantics - main. For more related content, please pay attention to the PHP Chinese website (www.php.cn)! <header>Header</header>
<div id="content">Main Content</div>
<footer>Footer</footer>
<header>Header</header>
<main id="content">Main Content</main>
<footer>Footer</footer>