recently in the project to use the HTML5 part of the label, the master reminds me to feel that the number of sections of a bit too much, today went to find a HTML5 new label use method, specially posted up, thanks to the original author's sharing, convenient later use ~ ~ ~
the call of the HTML5 era
The previous generation of HTML standards: HTML 4.01 and XHTML 1.0 were released today for more than 10 years, and web-side applications have been transformed. And the Web front end does not have a unified universal Internet standard, each browser has too many incompatible, in maintaining these browser compatibility waste too much time. Then there is the multimedia operation, animation and so on need third-party plug-in support, and this caused the problem of multi-platform compatibility, and this all in HTML5 will become the standard, so fundamentally solve the browser differences and some third-party plug-in problems, so that the Web application more standard, more versatile, And more independent of the device.
HTML5 is not a revolutionary change, but a development. It is also compatible with many of the previous HTML4 standards, and all Web applications made with the latest HTML5 standards can be easily run on older versions of the browser. HTML5 Standard is indeed integrated with a lot of practical functions such as: Audio and video, local storage, socket communication, animation, etc. are before the application development really feel the web side of the chicken to get attention and upgrade, I believe if you have relevant experience will be very touched.
The goal of HTML5 is to: it provides standards for developing simpler, more independent, standard generic Web applications through new tags and new features. The new standard solves three major problems: Browser compatibility, solves the problem of unclear document structure, and solves the problem that the Web application function is limited.
the difference between HTML4 and HTML5
1. Cancellation of some outdated HTML4 tags
These include purely display-effect markers, such as <font> and <center>, which have been completely superseded by CSS.
Other CANCELLATION properties: acronym, applet, Basefont, big, center, dir, font, frame, frameset, Isindex, Noframes, Strike, TT.
2. Added some new elements
For example: more intelligent Form Tags: date, email, URL, etc., more reasonable Tags: section, video, progress, nav, meter, time, aside, canvas and so on.
3. New Global properties: ID, TabIndex, repeat
4. File type declaration (<! doctype>) Only one type: <! DOCTYPE html>.
5, the new JS API
There are many other changes that I will cover in the following series of posts.
new structure label for HTML5
In the previous HTML page, we basically used the div+css layout. While the search engine to crawl the content of the page, it can only guess the content of one of your div is the content of the article container, or the navigation module container, or the author introduced the container and so on. This means that the entire HTML document structure is not clearly defined, HTML5 in order to solve this problem, specifically added: header, footer, navigation, article content and other structure-related structural element tags.
Before we talk about these new tags, let's look at the layout of a normal page:
We see very clearly, a normal page, there will be the head, navigation, article content, as well as the attachment of the right column, as well as the bottom of the module, and we are through the class to distinguish, and through the different CSS style to deal with. but the relative class is not a universal standard specification, the search engine can only guess the function of a certain part , the other is this page program to the visually impaired people to read, the document structure and content will not be very clear. The new layout that HTML5 new tags brings is the following scenario:
The associated HTML code is:
<body>
With the understanding of the above direct senses, we hit below to introduce the relevant structural tags in HTML5.
Section label
<section> tags, defining sections in the document. such as chapters, headers, footers, or other parts of the document. Typically used for section content, a new section is started in the document flow. It is used to represent common document content or application chunks, usually composed of content and its title. but the section element tag is not an ordinary container element, it represents a thematic content, usually with a title .
When we describe a specific thing, we usually encourage the use of article instead of section, and when we use section, we can still use H1 as the title, without worrying about where it is and whether it is used elsewhere; When a container needs to be defined directly or defined by a script, it is recommended to use a DIV element rather than a section.
What is <section>
Article label
<article> is a special section tag that has more explicit semantics than section and represents a separate, complete block of related content that can be used independently of the rest of the page. For example, a full forum post, a blog post, a user comment, and so on. In general, article will have a title section (usually included in the header) and sometimes include footer. Article can be nested, the inner layer of the article external layer of the article label has affiliation. For example, a blog post can be displayed in article, and some comments can be embedded in the form of article.
<article>
Nav Label
The Nav tag represents a part of the page, a group of links that can be navigated as a page, where navigation elements are linked to other pages or other parts of the current page, making the HTML code more accurate in semantics and better for devices such as screen readers.
<nav><ul><li> Hou de it</li><li>flydragon</li><li>j dragon Sky Surprise </li></ul ></nav>
Aside label
Aside tags are used to load non-body content and are treated as a separate part of the page. It contains content that is separate from the main content of the page and can be deleted without affecting the content of the page, the chapters, or the information the page is about to convey. Examples include ads, groups of links, sidebar, and so on.
<aside>
Header Label
Usually
Footer Label
The footer tag defines the footer of a section or document that contains information about a page, article, or part of the content, such as the author or date of the article. As a footer for a page, it typically contains copyrights, related files, and links. It is basically the same as the
<footer>[email protected] Hou de it</footer>
Hgroup Label
The hgroup tag is a combination of the header elements (H1-H6) of a Web page or sections section. For example, in a section where you have successive H-series label elements, you can enclose them in hgroup.
Figure label
Used to group elements. Used for pictures and picture description combinations.
<figure><figcaption> here is a description of the picture </ Figcaption></figure>
HTML5 study Notes (1)-New tags