惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
Arctic Wolf
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Google Online Security Blog
Google Online Security Blog
Help Net Security
Help Net Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
The Exploit Database - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security Affairs
N
News and Events Feed by Topic
Forbes - Security
Forbes - Security
月光博客
月光博客
博客园 - Franky
The GitHub Blog
The GitHub Blog
O
OpenAI News
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
V
Visual Studio Blog
爱范儿
爱范儿
S
Secure Thoughts
T
The Blog of Author Tim Ferriss
SecWiki News
SecWiki News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
J
Java Code Geeks
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cisco Blogs
博客园 - 三生石上(FineUI控件)
Hacker News: Ask HN
Hacker News: Ask HN
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
人人都是产品经理
人人都是产品经理
腾讯CDC
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
The Last Watchdog
The Last Watchdog
博客园 - 叶小钗
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
PCI Perspectives
PCI Perspectives
罗磊的独立博客
有赞技术团队
有赞技术团队
B
Blog RSS Feed
L
LINUX DO - 最新话题

博客园 - 珠海小肥Q

jQuery load()方法用法集锦! 异步无阻塞加载JS 【转载】jQuery的性能规则 【转载】开发杀手级企业应用10规则 国人开发的 Jquery UI -- MiniUI 治近视的秘方!1000度近视降到只有200度,不知道有没有用,试试(转) 欢迎需求变动,拥抱变化 (转) 睡觉的诀窍(转) 警惕“29岁现象” (转) 遇到强势客户,如何开展需求工作 (转) 企业管理软件平台架构内幕揭秘 (转) Silverlight 2 Beta 1学习资源(转) 网络上看到的对UE的总结 新瓶旧酒ASP.NET AJAX系列文章索引(转) EXT核心API详解(转) JavaScript的世界从来没有像现在这样精彩(转) 存储过程编写经验和优化措施(转) 数据库优化设计方案(转) 做杀猪软件如何做成明星CIO?(转)
HTML结构 记录下
珠海小肥Q · 2012-07-05 · via 博客园 - 珠海小肥Q

下面是HTML5的一部分新的语义元素:

  • article   

  • aside

  • figcaption

  • figure

  • footer

  • header

  • hgroup

  • mark

  • nav

  • section

  • time

  由于这些元素的语义很丰富,相信你可能会猜出其中大部分元素的作用。

  为了说得更清楚,下面给出一张图示。

enter image description here

  header和footer的作用不言自明,nav将创造一个导航条或者菜单条。此外,你可以用section和article将页面内容分为几个部分。最后,aside元素用来安置附带的内容,比如说,以边栏的形式放上一些相关链接。

  下面是一个简单的例子,其中的代码就用到了这些元素。

1 <!DOCTYPE html><html><head>    <meta charset="utf-8" />    <title>Title</title>    <link href="css/html5reset.css" rel="stylesheet" />    <link href="css/style.css" rel="stylesheet" /></head><body>    <header>        <hgroup>            <h1>Header in h1</h1>            <h2>Subheader in h2</h2>        </hgroup>    </header>    <nav>        <ul>            <li><a href="#">Menu Option 1</a></li>            <li><a href="#">Menu Option 2</a></li>            <li><a href="#">Menu Option 3</a></li>        </ul>    </nav>    <section>        <article>            <header>                <h1>Article #1</h1>            </header>            <section>                This is the first article.  This is <mark>highlighted</mark>.            </section>        </article>        <article>            <header>                <h1>Article #2</h1>            </header>            <section>                This is the second article.  These articles could be blog posts, etc.              </section>        </article>    </section>    <aside>        <section>            <h1>Links</h1>            <ul>                <li><a href="#">Link 1</a></li>                <li><a href="#">Link 2</a></li>                <li><a href="#">Link 3</a></li>            </ul>        </section>        <figure>            <img width="85" height="85"                 src="http://www.windowsdevbootcamp.com/Images/JennMar.jpg"                 alt="Jennifer Marsman" />            <figcaption>Jennifer Marsman</figcaption>        </figure>    </aside>    <footer>Footer - Copyright 2011</footer></body></html>

  当然,在这个例子里,我也引出了另外几个新元素。