As early as 2013, the
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.
It is noteworthy to use the
According to the specification, if you try to use multiple
Another requirement for the
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. As you can see, using the The above is the detailed content of Detailed explanation of examples of main element in h5. For more information, please follow other related articles on the PHP Chinese website! <header>Header</header>
<p id="content">Main Content</p>
<footer>Footer</footer>
<header>Header</header>
<main id="content">Main Content</main>
<footer>Footer</footer>
Summary