HTML5 structural tags 初步

什么是HTML5?
HTML5, the latest version of the Hypertext Markup Language (HTML), is the most radical revision
of the language to date. It introduces many new features in a variety of areas. Some of the more
notable additions include:
• Built-in multimedia tags for audio and video
• A canvas tag for drawing content in the browser
• Smarter forms that let you do things such as validation through the use of a required attribute

HTML5 doctype

The doctype declaration should be the first thing in an HTML document, before the tag.


HTML4 approach:

Simple HTML page using div tags
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>
A Simple HTML Page Using Divs
</title>
</head>
<body>
<div id='header'>Header</div>
<div id='content'>Content</div>
<div id='footer'>Footer</div>
</body>
</html>


HTML5 new tags are:
1. header 标记一个section的头部
2. section 类似于一本书的章节
例子:
<header>Header</header>
<section>
<p>
This is an important section of the page.
</p>
</section>
<div id='footer
3. article 重要的内容块
例子:
<header>Header</header>
<section>
<article>
<p>
This is an important section of content on the page.
Perhaps a blog post.
</p>
</article>
<article>
<p>
This is an important section of content on the page.
Perhaps a blog post.
</p>
</article>
</section>
4. aside
例子:
<section>
<article>
<p>
This is an important section of content on the page.
Perhaps a blog post.
</p>
<aside>
<p>
This is an aside for the first blog post.
</p>
</aside>
</article>
<article>
ibm.com/developerWorks/ developerWorks®
New HTML5 structural tags Page 7 of 11
<p>
This is an important section of content on the page.
Perhaps a blog post.
</p>
</article>
5. footer
6. nav

你可能感兴趣的:(html,html5)