HTML5 is the latest HTML standard, or late or early, all webProgramThe staff will find that this latest standard is needed, and many people will feel that it is much easier to re-develop an HTML5 website than to migrate a website from html4 to html5, this is because the two versions are very different. 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 will change each 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 have endured the bloated Flash video loading and running for a few years, 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 new tags, such as 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, apart from Code In addition to organization, it can also improve Seo performance and make 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 official guidance says these tags can be better processed through CCS, but in this way Article If this mark appears in one or two places, 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. And new modifications are constantly increasing. Therefore, if you want to track the latest trends in real time, you need to check the w3.org Differences between html4 and html5. This page. 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. |