Semantic Cognition and understanding of HTML5 tags (1)

Source: Internet
Author: User

With the increasing processing capacity of servers, Internet-level development has finally begun to become increasingly popular (I and many people said a few years ago that we should not simply focus on the so-called enterprise-level development, but will soon enter the Internet-level development ), HTML5 push brings more opportunities and hotspots to front-end technologies.

I use VS2008 development tools. As a representative of lazy people (who have strong dependence on development tools, are too lazy to remember API words, too lazy to type more, and too lazy to check manuals, intelliisense has always been a very important thing for me. I like Microsoft's development platform, that is, I like development on Microsoft's platform only when VS development tools have good and high-speed intelliisense, for those who are used to using notebooks, I have always admired and never refused. When VS2008 does not have good support for HTML5, I never practiced it until I saw "HTML 5 intelliisense and validation schema for Visual Studio 2008 and Visual Web Developer, I started to support HTML5 in VS2008. At least element and CSS development had the intelliisense service for the lazy. Sorry, I'm so happy. Unfortunately, I have not yet supported the DOM's Scripting script API (Oh, you can argue with many friends about how to express this. You can understand what I mean, this plug-in does not support HTML5, such as canvas. getContext ).

 
After downloading this plug-in, we can see the new HTML5 verification architecture in the tool -- option, which can also be counted as the target verification architect HTML5 in the page development environment. At the same time, some intelliisense support for html tags and css is started.
 
The earliest and most impressive, especially for lazy people like me, the most important thing to remember is that the initialization of html elements is very simple to the extreme.
 

1 <! DOCTYPE html>
2 3 4 <title> </title>
5 6 <body>
7 </body>
8

I was very excited when I first heard that I didn't want to write the content in DOCTYPE. I finally didn't want to write any messy things, I am ashamed to help you with all IDE solutions.

Next, let's talk about the new elements of HTML5. Before learning about the new elements, I would like to explain my personal views. The use of tags is a matter of opinion. The standard is a guide and reference, different people have different understandings of Harry Potter (Shakespeare I am not talking about you). My understanding begins with the semantic tag of HTML4:

  1. Tags are classified in many ways. In HTML4, I simply divide tags into default blocks and default inline, and divide tags into semantic and non-semantic (style labels are not discussed.
  2. In addition to div I, all other labels have semantics (under the Declaration, style labels such as font have long been not used in HTML4 ), div only logically treats some labels as a group and can be processed together.
If you agree with me, you will also agree that many new structure-based elements in html5 are used to replace div, or replace part of div. These elements are used to describe the use of element regions and groups. The reason is that in the future, web pages will not only be viewed by browsers on PCs, but also be provided to mobile devices, proprietary devices, and browsers on small devices for convenience, these browsers need to re-process the page content in different environments to give users a better reading experience. The content of all pages must provide valuable guidance to the browser, this allows the browser to handle cropping, highlighting, and specific operations. All documents should have a header element, especially the page itself is a document object. If there is no special reason, the top part of your page should have a header element, other articles may have headers. Be careful to avoid header misuse. the header indicates a set of auxiliary texts of the nature of the introductory or navigation, remember the navigation and introductory keywords.

Therefore, the top header of the page should contain a navigation label: nav. Although it seems that there are no necessary rules, I think that nav should only contain ol or li elements. After all, nav is used for navigation, and navigation should be a set of paths. Header can also contain other information for introduction, such as the company icon, company name, or product name on the homepage.

 
01 <body>
02 03
04 05 ***** companies 06 <nav>
07 <ol>
08 <li> Navigation 1 </li>
09 <li> navigation 2 </li>
10 <li> navigation 3 </li>
11 <li> navigation 4 </li>
12 <li> Navigation 5 </li>
13 </ol>
14 </nav>
15 16 </body>
Of course, this can also be written.
 
 
01 <body>
02 03 04
05 06 <nav>
07 <ol>
08 <li> Navigation 1 </li>
09 <li> navigation 2 </li>
10 <li> navigation 3 </li>
11 <li> navigation 4 </li>
12 <li> Navigation 5 </li>
13 </ol>
14 </nav>
15 16 </body>
Let's just say that the ol and ul are retained in HTML5. My personal suggestion is to remove the similar elements with complicated interpretations, such as retaining abbr and dropping acronym, unfortunately, both ol and ul are retained, but I suggest using ol. For document pages, such as the homepage of a blog with the Primary and Secondary titles, you can use the hgroup element in the header for processing.
 
 
01 02 03 working like an ant, living like a butterfly
04 05 06 keep a record of growth
07 08 <p>
09. Preface of a later article </p>
10 The document itself can be marked with the article element, which can describe the entire article and all its information. Usually articles also contain headers (I am talking about often) or hgroups (this is not necessarily needed ).
 
Does article need a header? Are there several ways to determine whether H and some descriptions combine the header information? If there is only H and there is no other description, you do not need to use the header.
 
 
1 <article>
2 3 title
4 5 </article>



If there is a primary subtitle, but there is no descriptive description, then the direct hgroup can also



01 <article>
02 03 04 main title
05 06 07 subtitle
08 09 10 </article>

 

Now we should be more interested in the header to describe to the browser which is the header area of the document. Today, I am exhausted. I will continue to understand and recognize HTML elements tomorrow. For HTML5, I agree with the principle of being self-explanatory and not reluctant. An element is the most suitable for us to understand where to use it. It makes sense to use it.

From Chen Zhen's blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.