Preliminary Exploration of HTML5-Basic HTML5 templates

Source: Internet
Author: User

I have been using HTML5 for a while, but I have no time to learn it systematically. Recently, I started preparing to systematically learn HTML5. By the way, I will write my own learning experiences. First, let's take a look at the basic templates of HTML5. from the definition of the basic structure, we can see that the basic templates of HTML5 are more concise. There are no tedious DTD definitions, just use one <! Doctype html> defines the HTML5 standard, and only <meta charset = "UTF-8"> defines the character encoding of the document. Careful students certainly find out why <meta charset = "UTF-8"> instead of <meta charset = "UTF-8"/>? Why is there no mark for this closed tag? This is a non-conforming rule in the previous standard, or is it a WEB standard. The concise style is the current version of HTML5 syntax. Let's take a look at the basic template to discuss this.
Let's take a look at the basic HTML5 template. By the way, we can compare it with the previous version.
<! Doctype html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Title> untitled document </title>
</Head>
<Body>
</Body>
</Html>
Basic Template of XHTML1.1
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
</Head>
<Body>
</Body>
Basic HTML 4 Template
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> untitled document </title>
</Head>
<Body>
</Body>
</Html>
One of the biggest changes to HTML5 templates today is simplicity. Looking at the previous definitions, all of them have version numbers, but now HTML5 has no version number.
In HTML5 verification, the syntax style is completely ignored. An error is reported only when an Encoding Error occurs and the file is terminated. This is why the slash closed tag mentioned above is omitted. All tags in XHTML need to be closed, including the element closure (for example, In addition, tags in HTML5 are not so case-insensitive, and Boolean attributes (such as disable and enable) can also be left unspecified.
So far today, we will continue to learn about HTML5 tags tomorrow.


From Red straw hat * Arain

 

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.