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