html5--'s understanding of HTML5

Source: Internet
Author: User

First of all, thank Li Gang's teacher for this book, "Html5/css3/javascript Handout", today read the contents of the first chapter, the strike, summed up.

The era of HTML5 has come, and it is a boon for all front-end developers. HTML5 is committed to solving cross-browser issues and can partially replace JAVASCRIPT,HTML5 's commitment to turning the browser into a front-end execution program environment rather than simply a view tool.

the first part, understanding HTML and XHTML

Html--hyper text Markup Language (Hypertext Markup Language), its history is more complex, the introduction of HTML from the end of 1991, when HTML is not strictly defined, All the way to html2.0,html3.2,html4.0,html4.0.1,xhtml1.0. XHTML is a thoroughly tempered.

Xhtml--extensible Hyper Text Markup Language (Extended Hypertext Markup Language).

HTML4.0.1 and XHTML have good compatibility, and XHTML is a stricter, purer HTML code.

We habitually think that HTML is a structured document, but in fact the syntax of HTML is very free, tolerant (mainly the results of each browser indulgence) such as the following code, HTML tags halves, very nonstandard:

This is a clear violation of the rules of structured documents, but when you browse the document with a browser, you can still see the browsing effect-this is where HTML is not standardized. While XHTML is committed to eliminating this specification, XHTML requires that an HTML document must first be an XML document.

Usually, the browser in the computer can deal with a variety of non-standard HTML documents, but now many browsers run on mobile phones and handheld devices, they do not have the ability to deal with those bad markup language.

Part II: From XHTML to HTML5

WHATWG (Web Hypertext Application Technology workding Group,web Hypertext Technology Working Group) has developed a new HTML standard, HTML5.

A large number of surveys show that even in some formal websites, few websites can be verified by HTML specifications. Only 6.57% of Web sites conform to HTML specification validation. If you take those little-known small sites into account, the entire internet is almost a non-compliant HTML page.

There are a large number of existing HTML pages in the following 4 non-conforming content

1. The element's label is mixed in case. Like:<p></p>.

2. The element does not have a reasonable end. For example: Only <p> does not have </p>.

3. The attributes in the element do not specify a property value. For example <input type= "text" disabled>.

4. No quotation marks are used when specifying attribute values for the attributes of an element. For example: <input type=text>.

For the sake of "being reasonable", WHATWG organization began to define a "compromise" specification: HTML5. HTML5 of adults and above are in compliance with the norm. HTML5 is the realization of the compromise by the norm-makers.

Advantages of HTML5:

From HTML4.0.1, XHTML to HTML5, it's not a revolutionary upgrade, it's a compromise of the norm to the habit, so the excess from HTML to HTML5 is very easy.

1. Resolve cross-browser issues.

Cross-browser problem is absolutely a perpetual "nightmare", the advent of HTML may change this situation, the current mainstream browsers such as: IE, Chrome, Firefox, Opera, Safari have shown great enthusiasm for HTML5. If browsers follow the HTML5 specification, it will be easier for the front-end programmers to develop html+css+javascript pages.

2. Partially replaces the original JavaScript.

For example, HTML5 was implemented before: to open a page immediately after a line of text box to get the focus, to be implemented through JavaScript, and now only need to add a property (autofocus).

<input type = text Autofocus name = price/>

3. More explicit semantic support.

(1) HTML5 provides

(2) HTML5 provides two new elements <time>2017-4-18</time>;<mark> tagged languages </mark> provides richer semantics compared to the original <em. /> (em denotes what is emphasized, but which one is unclear).

4. Enhanced the functionality of the Web application.

HTML has been tightly constrained, and the Client downloads HTML page data from the server, and the browser is responsible for rendering the HTML page data. For the sake of client security, the previous HTML was secure enough for security.

So, we need to increase the functionality of HTML by other means, such as Javascriptlai.

the grammatical changes of HTML5

1. Labels are no longer case sensitive.

2. The element can omit the end tag.

3. Allow attributes that omit attribute values.

4. Allow attribute values to not use quotation marks. (However, it is strongly recommended to use quotation marks to enclose this particular attribute value when you have a property value that can easily cause a browser to mix with spaces, for HTML5)

Summary: HTML5 said that the non-compliant HTML as a specification, adding some new APIs, new practical features.


This article is from the "Five Piglets" blog, please be sure to keep this source http://wuxiaozhu.blog.51cto.com/7942143/1914183

html5--'s understanding of HTML5

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.