Home  >  Article  >  Web Front-end  >  What are the differences between html4 and html5?

What are the differences between html4 and html5?

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-06-08 15:16:575611browse

The differences are: 1. The difference in definition, HTML4 is produced to adapt to the PC era, and HTML5 is produced to adapt to the mobile Internet era; 2. The difference in tags, HTML5 code is more concise than HTML4 code; 3 , HTML5 adds a variety of elements; 4. HTML5 is more suitable for the requirements of the times.

What are the differences between html4 and html5?

The operating environment of this tutorial: Windows7 system, HTML4&&HTML5 version, Dell G3 computer.

HTML5 has developed at an alarming rate since its official launch in 2010. Now mainstream browsers basically support HTML5 (except for some individual features that have browser compatibility issues). This shows that HTML5 is becoming more and more popular. welcome. It can be predicted that HTML5 will become the mainstream technology of web front-end in the near future. HTML5 special effects are better adapted to the mobile Internet era and can better support multimedia running on mobile devices.

What is the difference between html5 and html4?

Difference in definition

HTML5 is the fifth modification of Hypertext Markup Language (HTML), HTML4 is Hypertext Markup Language (HTML) The fourth revision, they are the 5th and 4th versions of the HTML language respectively. HTML4 was produced to adapt to the PC era, and HTML5 was produced to adapt to the mobile Internet era. They are all standard languages ​​recommended by w3c (World Wide Web).

The difference between tags

HTML5 code is more concise than HTML4 code. Some new elements and new attributes of HTML5 can make web development easier and simpler, such as HTML5 Improved API. Before HTML5, many functions had to be implemented using JavaScript, but now you can just use the tag attributes of HTML5 elements. Because HTML5 has a large number of replaceable script (javascript) attributes on web pages, it makes the language simple and easy to understand, and HTML4 alone needs to cooperate with javascript to achieve this.

New elements

HTML5 adds canvas element (painting), video element (media playback), audio element, new special content elements (article, footer, header, nav, section), form controls (calendar, date, time, email, url, search), for example, the div used before can now be replaced by HTML5 structured tags, which makes the entire page more intuitive and easy to understand.

HTML5 is more suitable for the requirements of the times

The mobile Internet era is more eager to have a unified standard than the PC era. Previously, due to the inconsistency between browsers, a lot of time was wasted due to bugs caused by modifying browser compatibility. In HTML5, video, audio, images, and animations will be standardized, which will solve the headache of browser compatibility.

The difference between markup methods

HTML5 syntax is mainly DOCTYPE (DOCTYPE declaration method: ) and specified character encoding (append charset attribute to mate element Specified encoding: ) is different from html4.

Recommended learning: html video tutorial

The above is the detailed content of What are the differences between html4 and html5?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn