Comment: Although HTML5 does not completely subvert HTML4, they are also a little different. This article has compiled some visible differences. Just master some first, and it is not too late to study them carefully after all. Interested friends should not miss it.
HTML5 is the next version of the HTML standard. Although HTML5 does not completely subvert HTML4, they also have some differences. Please see the latest and most complete HTML5-HTML4 comparison information, it seems to be a little more. In this world where IE still exists, you can first master the differences in HTML5, and it is not too late to study it carefully after all support.
1. Simplified syntax
HTML5 simplifies a lot of subtle syntax, such as the statement of doctype, you just need to write <!doctype html>. HTML 5 specifies UTF-8 encoding as follows <meta charset=UTF-8>
2. <canvas> tag replaces Flash
Flash has caused trouble for many web developers, and playing Flash on a web page requires a bunch of code and plug-ins. The <canvas> tag allows developers to interact with users with UI as long as they use one tag.
3 Added many new tags
One principle of HTML5 design is to better reflect the semantics of the website, so tags such as <header> and <footer> are added to clearly indicate the structure of the web page; adding <section> and <article> tags, <section> and <article> are also conducive to clarifying the structure of the web page and more conducive to SEO; adding <menu> and <figure> tags, <menu> can be used to create traditional menus, or to toolbars and context menus. <figure> tags make web text and pictures more professional in layout; new <audio> and <video> tags are added, these two tags may be the two most useful tags in HTML5, and they are also very convenient to use. For example, embedding videos in HTML5 pages only takes a small piece.
<video controls>
<source src="jamshed.mp4" type="video/mp4">
Your browser does'nt support video embedding feature.
</video>
Similarly, audio and other things are similar.
4. Brand new form
HTML5 has made a lot of modifications to the <form> and <forminput> tags, added many new attributes, and modified many attributes.
5. Delete the <b> and <font> tags, <frame>, <center>, <big> tags
6.HTML5 supports different types of storage types
HTML5 supports local storage, and was implemented through cookies in previous versions. HTML5 local storage is fast and secure. And HTML5 has two different objects that can be used to store data. HTML5 stores and accesses data through JS:
localStorage is suitable for long-term storage of data, and data will not be lost after the browser is closed.
sessionStorage is just a session data storage, and the stored data is automatically deleted after the browser is closed.
In general, HTML5 has gone beyond the scope of markup languages, and more semantic tags will make HTML5 more useful. Canvas+WEBGL and other technologies realize plug-in-free animation and image and graphics processing capabilities; local storage can realize offline applications; websocket, changing the pure pull model of http to realize the dream of data push; MathML, SVG, etc., supports richer renders, etc. Now, the understanding of HTML5 is still at the surface stage. In the future, I will read more HTML5 books and add some insights.