What is the difference between HTML 5 and HTML 4?

Source: Internet
Author: User

HTML5 is the next version of the HTML standard. Although HTML5 does not completely subvert HTML4, there are some differences. The latest and most complete HTML5-HTML4 contrast information please see http://dev.w3.org/html5/html4-differences/, looks like a little more. In this IE still exist in the world, the difference of HTML5 first grasp some can, and so on all support after careful study is not too late.

1. Simplified grammar
HTML5 simplifies a lot of subtle syntax, such as DOCTYPE's statement, and you just have to write <!doctype html>. HTML 5 Specifies the UTF-8 encoding in the following way <meta charset= "UTF-8" >

2. <canvas> Label replaces Flash
Flash brings trouble to many web developers, and it takes a bunch of code and plug-ins to play flash on a Web page. <canvas> tags make it possible for developers to interact with the user by using just one tag.

3 Add a lot of tags
One of the principles of HTML5 design is to better reflect the semantic nature of the site, so add tags such as

Copy code code as follows:

<video width= "450" height= "controls>"
<source src= "Jamshed.mp4" type= "Video/mp4" >
Your Browser does ' NT support video embedding feature.
</video>

Similarly, audio and others are similar.

4. A new form
HTML5 has made a lot of changes to <form> and <forminput> tags, added a lot of new attributes, and modified many properties.

5. Delete <b> and <font> tags, <frame>, <center>, <big> tags

6.HTML5 support for different types of storage types

HTML5 supports local storage, which was implemented through cookies in previous versions. HTML5 Local storage fast and secure. And HTML5 has two different objects that can be used to store data, HTML5 to store and access data through JS:

Localstorage is suitable for long-term storage of data, the browser is closed after the data is not lost
Sessionstorage is only for a session of the data store, stored data is automatically deleted after the browser is closed

In general, HTML5 has gone beyond the realm of markup languages, and more semantic tags will make HTML5 more useful. Canvas+webgl and other technology, the realization of the animation and image, graphics processing capabilities, local storage, to achieve offline applications, WebSocket, a change of HTTP pure pull model, to achieve the dream of data push, mathml,svg and so on, Support richer render and so on, and so on, now for the understanding of the HTML5 only stay in the surface stage, later will read a part of the HTML5 books to increase the insight.

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.