The difference between HTML5 and HTML4

Source: Internet
Author: User

HTML5is aHTMLthe next version of the standard. More and more programmers are beginning toHTML5to build the site. If you use bothHTML4and theHTML5words, you will find that withHTML5build from scratch, than fromHTML4Migrating toHTML5much more convenient. AlthoughHTML5not completely subversive .HTML4, they still have a lot in common, but theyThere are some key differences. Here's a list of theirTena key difference.

1. HTML5 standards are still being worked out.
The first thing to note is thatHTML5Although it is very hot now, butHTML5standards are still being developed and standards are still changing. HTML4have beenTenFor years, there will be no change.

2. Simplified Syntax
HTML5simplifies a lot of subtle syntax, such asDOCTYPEThe statement that you just need to write<!doctype html>on the line. HTML5with theHTML5,XHTML1compatible, but withSGML(standard generic superscript language) is not compatible.

3. <canvas> Label SubstitutionFlash
Flashto manyWebdevelopers are having trouble playing on the WebFlashrequires a bunch of code and plugins. <canvas>tags make it possible for developers to use just one labelcan and users generateUIinteraction. Although the current<canvas>tags are not yet implementedFlashall the features, but soon<canvas>it will letFlashlooks corny, haha!

4. Newand the<footer>label
HTML5one of the principles of design is to better reflect the semantics of the site, so addedand the<footer>such a label is used to clearly indicate the structure of the Web page.


5. Add <section> and <article> tags
with the similar, <section> and the <article> also helps to clarify the structure of the Web page, more conducive to SEO .

Note: <section> a label defines a section in a document ( Section , section). such as chapters, headers, footers, or other parts of the document.


6. <menu> and <figure> tags
< menu> can be used to create traditional menus, and also for toolbars and context menus. <figure> labels make the typography of Web pages and images more professional.

Note: All major browsers do not support Menu element.


7. new <audio> and <video> label
These two tags may be the most useful two tags in the html5 . As the name implies, these two tags are used to play audio and video.

8. New Forms
HTML5 pair <form> and <forminput> The tag has been extensively modified, with many new properties added, and many properties modified.

Note: <form> in html5 The new properties that are added are: autocomplete ( Specifies whether the auto-complete function of the form is enabled , novalidate ( does not validate the form when it is submitted . where novalidate properties apply to: <form> , And the following types of <input> Tags: text, search, URL, Telephone, email, password, date pickers, range , and color .


9. Delete <b> and <font> tags
This improvement is beyond my comprehension. I don't think the removal of these two tags is a great help to the code improvements. The official explanation is that CSS should be used instead of the two tags. But I still feel that for simple text, these two tags are still very convenient.

Delete <frame>, <center>,< big> label

The above 10 points are only a small part of the difference between HTML5 and HTML4 , the newest and most complete HTML5-HTML4 for more information, see http://dev.w3.org/html5/html4-differences/ .

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.