HTML5 standard introduction, html5 Introduction

Source: Internet
Author: User

HTML5 standard introduction, html5 Introduction

Recently, the front-end group is very lively, but I found that most of the questions are about javascript and css, as if you are trying to create various interactions and styles, forget all the basics-HTML.

In fact, I like HTML very much. I think this language is far more interesting than XML. It is flexible, lightweight, and far from being comparable to extremely standard XML. At the same time, HTML has its own certainty because of its extremely small scope of application and limited tag.

A large part of this series will introduce some basic concepts in HTML5 in a very short space, and:

Only focus on the HTML language, and other javascript or css will not be involved at all.
Only focus on HTML, which will be briefly included in XHTML, but will not be described in detail. This is because XHTML has stricter specifications than HTML. For browser parsing, it can be considered as a subset of HTML.
This document mainly references official whatwg documents and evaluates the compatibility of mainstream browsers.
The introduction is full of basic concepts and does not involve implementation details such as document parsing, DOM tree building, and script execution.
After that, some technical details related to the running of the browser may be extracted, such as the parsing and execution of scripts, for further discussion.

If you think HTML is uncomfortable, because the start tag and end tag can be omitted too nonstandard, this series will tell you that there are very strict rules for omitting HTML tags ......

If you think HTML is simple and cannot be written in XML, this series will tell you that HTML is full of traps, even if you do not consider the implementation of various browsers, you are not necessarily safe enough to walk through this minefield ......

Before starting this series, there were several very important concepts to be introduced. There are many concepts in HTML. For details, see Terminology. However, some of them are not widely referenced in reference manuals. Only one of them is meaningful:

Browsing context-browsing context
It is the page we usually see. For the exact landlord, the browsing context is an environment in which HTML will be parsed and constructed, and CSS styles will be calculated and applied, the javascript script is loaded and executed to display the content that the end user can see.

Generally, we have the following contexts:

A browser window, such as an IE6 window.
One label in a multi-tag browser. Firefox, Chrome, and other browsers do this.
An <iframe> element is also an independent browsing context.
In frameset, A <frame> element also forms an independent browsing context.
Line feed-new line
Like in basic computer courses, HTML defines three types of line breaks:

The U + 000D character, that is, the \ r character.
The U + 000A character, that is, \ n characters.
The character U + 000D followed by U + 000A, that is, the \ r \ n string.
Different systems have their default line feed output. The HTML regulations ensure that the browser can correctly parse the current three mainstream line feed methods.

Space-space
Spaces play an important role in HTML. For example, each attribute of an element can be separated by spaces. Under normal circumstances, developers will press the Space key to enter a space. When there are many attributes, they may use the carriage return to better arrange the attributes. But few people may think about it. Why is the carriage return effect the same as space? What other characters can HTML parse as spaces?

The U + 0020 character is a common space.
The character U + 0009 is the \ t horizontal tab.
The U + 000A character is the \ n linefeed.
The U + 000D character is the \ r carriage return.
Character U + 000C, which is a paging character, rarely seen.
About the space issue, jQuery has also made this problem, and even has it so far. In row 1738th of jQuery 1.5.1, a regular expression/[\ n \ t \ r]/g is defined to separate the class attributes of elements by spaces. In version 1.4.4, this regular expression is/[\ n \ t]/g, which clearly misses \ r. This BUG indicates this problem. Unfortunately, version 1.5.1 still does not take into account all space characters in the standard, that is, it does not process the U + 000C paging character.

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.