HTML5 adds more semantic tags, such as header, footer, nav ...... When we compile the page, we do not need to use the following method for layout:
<Div class = "header"> This is the header </div> <div class = "content"> This is the intermediate content area </div> <div class = "footer"> This is the bottom </div>
However, you can use this method to deploy:
<Header> This is the header
However, IE does not support Iot platform forward, so we need to add a little code in js and css to make it support IE6, as shown below:
document.createElement("header");document.createElement("content");document.createElement("footer");
Css:
header,content,footer{display:block}
The above means to customize a label as header and set it to block display. The complete code is attached below:
<! DOCTYPE html>
Let's talk about something unrelated. Why do we need to write html in semantic form?
First, the code is easy to read. When someone else looks at your code, they can understand it at a Glance. Second, SEO is helpful. Search engine crawlers will largely ignore the markup for performance, focus only on semantic tags.
So hurry up and use semantic tags to write your HTML. What's more, this is not hard, right?
Appendix 1: