Summary of major changes and improvements in HTML5 comparison with HTML4, and improvement in html4 comparison

Source: Internet
Author: User

Summary of major changes and improvements in HTML5 comparison with HTML4, and improvement in html4 comparison

During this period of time, I have been busy helping my teacher with projects. I often don't go to class, so I just spent some time in the lab and I have no time to read other things. I allocated the front-end page design in the project. Sometimes I can see that mobile apps and html5 are very popular recently. With the rapid development of mobile Internet, especially the 4G era, in addition, Microsoft has replaced IE with a new browser edge in win10, so many websites are now abandoning IE's development towards html5, which is a trend, especially for mobile Web pages, some compatibility problems still need to be solved between different browsers on PC, but html5 will become the dominant browser markup language in the near future.

What is html5?
Html5 was first named by WHATWG (Web hypertext Application Technology workgroup), followed by a combination of xhtml2.0 (standard) by W3C to generate the latest hypertext markup language. It can be simply understood as: HTML 5 ≈ HTML + CSS 3 + javascript + API

The static web pages developed by the web Front-end are generally html4.01. It also complies with W3C specifications. So what are the substantive differences between them?

1. on the document type declaration
Html:

Copy XML/HTML Code to clipboard
  1. <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <Html xmlns = "http://www.w3.org/1999/xhtml" xml: lang = "en">

Html5:

Copy XML/HTML Code to clipboard
    Copy XML/HTML Code to clipboard
    1. <! DOCTYPE html>
    From the comparison between the two, we can see that in the Document declaration, html4 has a long piece of code, and it is difficult to remember this piece of code. Many people must rely on tools to directly generate it? Html5 is different. Only Simple declarations make it easier for people to remember.

2. Set page character encoding
In HTML5, you can specify the character encoding by directly appending the charset attribute to the <meta> element, as shown below:

Html: <meta charset = UTF-8 ">

Html5: <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

From HTML5, UTF-8 is recommended for character encoding of files.

3. Structure Semantics
Html: There is no tag indicating the structure semantics. We usually name the div id = "header" in this way to indicate the website header.

Html5: it has great semantic advantages. Provides some new tags, such as header, article, and footer.

What are the benefits of providing such a label? I think the most important thing is SEO optimization. Whether we name the webpage module ourselves or there are such labels. Because there is only one final purpose for a website, that is, profit. If you want to make a profit, you only need to use SEO optimization technology to rank your website, so that your website has value. This is exactly what html5 meets. Why? Because the tags he defines are more conducive to optimization, and spider can recognize you.

4. Other New Content
The new input types include number, date, color, and range.

New inline elements include time, meter, and SS.

New embedded elements include video and audio. New interaction elements include details, datagrid, and command.

5. The <canvas> label replaces Flash.
Flash brings troubles to many Web developers. A bunch of code and plug-ins are required to play Flash on webpages. <Canvas> Labels allow developers to use only one tag to interact with the user's UI. Although currently, the <canvas> label cannot implement all Flash functions, soon <canvas> will make Flash look boring, haha!

6. abolished Elements
Elements that can be replaced by css: For basefont, big, font, s, tt, u, these elements, their functions are purely screen display services, HTML5 advocates unified editing of the image display function in css styles, so these elements are abolished.

Frame framework is no longer used: Since the frame framework has a negative impact on the Web page availability, html5 does not support frame, only supports iframe framework, or a composite page composed of multiple pages created by the server.

Only some browsers support the following elements: applet, bgsound, blink, marquee, and so on. Bgsound and marquee are only supported by ie and abolished by html5. Here, applet elements can be replaced by embed elements or object elements, bgsound elements can be replaced by audio elements, and marquee can be replaced by javascript programming.

Conclusion: Although html5 has been available in the past few years, it was not yet available because it was not mature enough and the time was wrong. The rapid development of the Internet is also in the 4G era. We are out of hml5 + css3!

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.