Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example Analysis of the main changes and improvements of HTML4 compared with HTML5

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Compared with the example analysis of major changes and improvements in HTML4, HTML5 believes that many inexperienced people do not know what to do about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

What is html5?

Html5 is a hypertext markup language named by WHATWG (Web Hypertext Application Technology working Group), and then combined with xhtml2.0 (standard) organized by W3C to produce the latest generation of hypertext markup language. It can be simply understood as: HTML 5 ≈ HTML+CSS 3+javascript+API

The static web pages that we now develop at the web front end are usually html4.01. At the same time, it conforms to W3C specification. So what is the real difference between them directly?

1. On the document type declaration

Html:

XML/HTML Code copies content to the clipboard

Html5:

XML/HTML Code copies content to the clipboard

XML/HTML Code copies content to the clipboard

From the comparison between the two can be seen: in the document declaration, html4 has a long piece of code, and it is difficult to remember this code, presumably many people are directly generated by tools, right? Html5 is different, only a simple statement, which is also convenient for people to remember.

two。 Set page character encoding

You can specify the character encoding in HTML5 by appending the charset attribute directly to the element, as shown below:

Html:

Html5:

Starting with HTML5, UTF-8 is recommended for character encoding of files.

3. In structural semantics

Html: there is no tag that reflects the semantics of the structure. This is how we usually name div id= "header". This represents the head of the site.

Html5: it has a great advantage in semantics. Some new tags are provided, such as header, article, footer

What are the benefits of providing such a label? I think the most important thing is the optimization of SEO, whether we name the web page module ourselves, or have such tags. Because there is only one ultimate goal of making a website, and that is to make a profit. If you want to make a profit, you have to rank your site through SEO-optimized technology, so that your site is valuable, and html5 meets this point. Why would you say that? Because he defines these tags, more conducive to optimization, spiders can identify you.

4. Other new content

New input types include: number (number), date (date), color (color), range (range), and so on.

New inline elements include time, meter, and progress.

The new embedded elements are video and audio. The new interaction elements are details, datagrid, and command.

5. Label replaces Flash

Flash brings trouble to many Web developers, and it takes a lot of code and plug-ins to play Flash on a web page. Tags allow developers to generate UI interactions with users by using a single tag. Although the current tag can not achieve all the functions of Flash, but it will soon make Flash look old-fashioned, !

6. Abrogated elements

Elements that can be replaced by css: for basefont, big, font, s, tt, u, these elements, because their functions are pure picture display services, while HTML5 advocates unified editing of picture display functions in the css style, so abolish these elements.

No longer use the Frame framework: because the frame framework has a negative impact on page usability, frame is not supported in html5, only the iframe framework is supported, or in the form of a composite page made up of multiple pages created by the server.

Only some browsers support elements: applet, bgsound, blink, marquee, and so on. Bgsound and marquee are only supported by ie and abolished by html5. Applet element can be replaced by embed element or object element, bgsound element can be replaced by audio element, and marquee can be replaced by javascript programming.

After reading the above, have you mastered the method of HTML5 comparing the example analysis of major changes and improvements in HTML4? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report