Home > Web Front-end > H5 Tutorial > body text

Xiaoqiang's road to HTML5 mobile development (3) - Comparison between HTML5 and HTML4

黄舟
Release: 2017-01-22 10:29:09
Original
1179 people have browsed it

In the previous section, we introduced the new features of HTML5, the use of new tags, intelligent form design, the introduction of multimedia objects, Canvas objects for your canvas, extended graphic tags, geographical applications in HTML5, independent data storage, and new network connections.

HTML 5 is the biggest leap forward in web development standards in the past decade. Unlike previous versions, HTML 5 is not just used to represent Web content. Its new mission is to bring the Web into a mature application platform. On the HTML 5 platform, video, audio, images, animations, and computer-based Interactions are standardized. (HTML5 also has its own logo). Learning Html5 requires mastering the following aspects of knowledge.

1. HTML basic knowledge

2. CSS style knowledge

3. JavaScript knowledge

Many friends who have learned HTML 4.0 before may now understand I feel very confused. What is the difference between HTML 4.0 and HTML5? How will learning HTML4.0 help learning HTML5? In fact, the biggest difference between HTML5 and HTML4 is that HTML5 pays more attention to content and structure rather than performance. For example:

<body>   
  
<header>  
<hgroup>导航相关数据</hgroup>  
</header>   
  
<nav>菜单</nav>   
  
<article>  
<h1>标题:HTML5专题</h1>  
发布日期:<time>19:00</time>  
<time datetime="2013-2-14">情人节</time>  
<p>测试相关内容</p>  
</article>  
  
<footer>   
<address>CSDN-大碗干拌的博客</address>  
</footer>   
  
</body>
Copy after login

Like the above many tags in html5, we can use the

tag instead in the previous html4, so why are there so many unused tags? This actually increases the difficulty of memory. ? In fact, this is not the case. There are many benefits to doing this. These tags with specific names make it easier to distinguish their respective functions. For example, they can be recognized on both PC browsers and mobile browsers and displayed in a good layout.


Another difference is that HTML5 has simplified more declarations and tags, also made detailed provisions on compatibility, abolished some elements, and added Some elements, such as the following declaration:

HTML4 declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0   
Transitonal//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-t......  
<html xmlns="http://www.w3.org/1999/xhtml">  
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
Copy after login

HTML5 declaration:

<!DOCTYPE html>  
<meta charset=utf-8/>
Copy after login

When introducing JavaScript or CSS files, in HTML4 The writing method is as follows:

<script src="js/juery-1.6.2.js" type="text/javascript"></script>
Copy after login

It becomes simpler in HTML5:

<script src="js/juery-1.6.2.js"></script>
Copy after login

Not only that, HTML5 accepts some looser syntax, such as

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!