What is the difference between Html4 and html5. what are the new functions of html5.

Source: Internet
Author: User


HTML5 is the latest HTML standard. It may be late or early, and all web programmers will find that they need to use this latest standard. Moreover, many people will feel that they have re-developed an HTML5 website, it is much easier to migrate a website from HTML4 to html5. this is because there is a big difference between the two versions.

In fact, HTML5 has not made any major changes to html4. many of them are similar.

However, there are some important differences you need to know. The main differences between HTML4 and html5. (not all, it is impossible to list all ):

1. HTML5 standards are still being developed

This difference is obvious, but it is very important. I need to start with it first. You may have noticed that HTML5's cool comments are everywhere, but the fact is that HTML5 is an unfinished standard. HTML4 is now 10 years old, but the fact that it is still the current formal standard has not changed.

On the other hand, HTML5 is still in the early stage, and future changes will continue to emerge. You must consider this because the newly added or modified web page elements you use on your website may change every year and you need to constantly update and upgrade your website, this is not what you want. This is why you 'd better use HTML4 in the product so far, just in the experiment.

2. Simplified syntax

The simpler doctype Declaration is one of the many new features in HTML5. Now you only need to write <! Doctype html>. The HTML5 syntax is compatible with HTML4 and XHTML1, but not SGML.

3. A new <canvas> flag that replaces Flash

For Web users, Flash is both a surprise and a pain. Many Web developers are not satisfied with the HTML5 threats to Flash. However, for those who endure the bloated Flash video that takes several years to load and run, the technology of generating video with the new <canvas> MARK has arrived.

Currently, the <canvas> flag cannot provide all Flash functions, but in time, Flash will be eliminated from the web. We will wait and see because many people do not agree with this idea.

4. New

HTML5 is designed to better depict the anatomical structure of the website. This is why these <Footer> and other new tags are designed specifically for these parts of the logo website.

When developing a website, you do not need to use the <div> mark to mark these parts of the webpage.

5. New <section> and <article> tags

Similar to the

It is estimated that in addition to making the code more organized, it can also improve the SEO effect, making it easier for search engines to analyze your pages.

6. New <menu> and <figure> labels

The new <menu> tag can be used as a normal menu or a toolbar or right-click menu, although these items are not commonly used on pages.

Similarly, the new <figure> tag is a more professional way to manage text and images on pages. Of course, you can use a style sheet to control text and images, but it is more suitable to use the HTML5 built-in mark.

7. New <audio> and <video> tags

The new <audio> and <video> tags may be the two most useful things added to HTML5. Like the tag names, they are used to embed audio and video files.

In addition, there are some new multimedia tags and attributes, such as <track>, which are used to provide text information for tracking videos. With these tags, HTML5 makes Web2.0 features more and more friendly. The problem is that before HTML5 is widely accepted, Web2.0 is still the old Web2.0.

8. Brand new Form Design

The new <form> and <forminput> tags completely modify the original form elements. They have many new attributes (and some modifications ). If you often develop forms, you should spend more time studying them in detail.

9. The <B> and <font> labels are no longer used.

For me, this is a change that I don't quite understand. I don't think removing the <B> and <font> tags will bring much benefit. I know that the official guide says these tags can be better processed through CCS, but in this way, in order to appear in one or two parts of the article, you need to implement this function in two separate places: css and text. Isn't it clumsy. Maybe we will get used to this method later.

10. no longer use the <frame>, <center>, <big> flag

As a matter of fact, I can't remember when I used these tags, so I am not sad to remove them. For the same reason, there are better tags to implement their functions-this is good, and any obsolete tags are welcome to be removed from the standard.

The differences between the 10 HTML5 and HTML4 are only a small part of the new specification. In addition to these major changes, I can also mention some minor changes, such as modifying the <ol> tag attributes so that they can be sorted in reverse order, the <u> tag is also modified.

There are a large number of minor changes. New modifications are also constantly increasing. Therefore, if you want to track the latest trends in real time, you need to regularly view different pages between HTML4 and html5. If you are in a hurry and want to use these new tags and attributes in your work, I suggest you do your best to just experiment. The reason is clear, these new tags and new attributes may change greatly in the future. Therefore, they may expire unless you constantly update your code.

Although most popular browsers support HTML5 in the latest version, some new (or modified) tags and attributes are not supported, therefore, Your webpage may display inconsistencies on the user's screen. Be patient and wait for HTML5 to be practical. It is not time yet.
 

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.