HTML5 Fundamental Syntax
HTML5 Fundamental Syntax
*/-->
HTML5 Fundamental Syntax
1 Adding Document Structure with HTML5’s New Elements
1.1 header
Is used to contain the headline(s) for a page and/or section . It can also contain
supplemental information such as logos and navigational aids.
1.2 footer
Contains information about a page and/or section , such as who wrote it, links to
related information, and copyright statements.
1.3 nav
Contains the major navigation links for a page and, while not a requirement, is
often contained by header .
1.4 aside
Contains information that is related to the surrounding content but also exists
independently, such as a sidebar or pull-quotes.
1.5 section
The section element is not a generic container element. When an element is needed only for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element's contents would be listed explicitly in the document's outline.
1.6 article
Is used for self-contained content that could be consumed independently of the page as a whole, such as a blog entry.
1.7 Modifying the Document Outline
You have a primary page title and tagline marked up with headings ( h1 and h2 , respec-tively), but you don’t want the tagline included in your document outline.
<hgroup>
<h1>HTML5, for Fun & Profit</h1>
<h2>Tips, Tricks and Resources</h2>
</hgroup>
In this example, only /h1/(the largest headline of those headlines) will be shown on the Document Outline.
2 Text
2.1 Emphasizing Text
You want to add emphasis or emphatic stress to text content.
<p>My name is <em>Jane</em>, not John.</p>
2.2 Adding Importance to Text
You want to indicate a span of text that is important.
<p><strong>Adding Importance to Text</strong></p>
2.3 Highlighting Text for Reference
You want to highlight the search term(s) in a list of search results.
<p><mark>Highlighting Text</mark></p>
2.4 Marking Up Small Print
You want to offset a legal disclaimer and copyright statement as small print.
<p><small>Small Print</small></p>
2.5 Defining Acronyms and Abbreviations
You want to provide expanded definitions for acronyms and abbreviations.
<p>I love working with <abbr title="Accessible Rich Internet Applications">ARIA</abbr> Roles</p>
<p>I love working with <acronym title="Accessible Rich Internet Applications">ARIA</acronym> Roles</p><!--Not Support-->
3 Adding Links to Block-Level Content
You want to wrap your site logo and main heading with a single hyperlink.
<a href="http://www.baidu.com">
<h1>HTML5, for Fun & Profit</h1>
<img src="img/logo.png" alt="HTML5 for Fun and Profit" />
</a>
4 Marking Up Figures and Captions
You want to include an illustration with a caption on your web page.
<figure>
<img src="img/logo.png" alt="The logo of HTML5" />
<figcaption>The logo of HTML5</figcaption>
</figure>
5 Marking Up Dates and Times
You want to encode date-time content for machines, but still retain human readability.
<p>Published: <time datetime="2011-01-15" pubdate>January 15, 2011</time></p>
<p>The class starts at <time datetime="08:00">8:00 am</time>.</p>
<p>Registration opens on <time datetime="2011-01-15T08:00-07:00">January 15, 2011 at 8:00 am, Mountain Time</time>.</p>
<p>Published: <time>2011-01-15</time></p>
I don't see what the diffience within an without <time>.
6 Setting the Stage for Native Expanding and Collapsing
You want to provide content that can expand and collapse with user focus (once browsers support it).
<details>
<summary>Upcoming Topics</summary>
<p>For the new year, we have a great line up of articles!</p>
<ul>
<li>Understanding the Outline Algorithm</li>
<li>When to Use <code>hgroup</code></li>
<li>Machine Semantics with Microdata</li>
</ul>
</details>
7 Controlling the Numbering of Your Lists
You want an ordered list to have numbering different than the default of starting with 1.
<ol start="2">
<li>Apple</li>
<li>Bananas</li>
<li>Oranges</li>
</ol>
8 Hiding Content to Show Later
You have content that you want to hide until after a user logs in.
<p hidden>You wouldn't see me if you don't log in.</p>
9 Making Portions of a Page Editable
You want to allow users to directly edit content in the browser.
<article contenteditable>
<h2>Stop <code>section</code> Abuse!</h2>
<p>As the most generic of the HTML5 structural elements, <code>section</code>
is often incorrectly used as a styling container, when <code>div</code> is more appropriate.</p>
</article>
10 Setting the Stage for Native Drag-and-Drop
You want to allow users to drag and drop content on your web page.
<h2 draggable="true">Block-Level Links</h2>
HTML5 Fundamental Syntax的更多相关文章
- 免费的HTML5连载来了《HTML5网页开发实例详解》连载(三)DOCTYPE和字符集
在2.1.2节中通过新老DOCTYPE的对比,读者可以清晰地看到HTML 5在精简旧有结构上做出的努力.DOCTYPE在出现之初主要用于XML中,用作描述XML允许使用的元素.属性和排列方式.起初HT ...
- 自由HTML5串行来到《HTML5具体解释Web开发的例子》连载(三)DOCTYPE和字符集
于2.1.2通过新老科DOCTYPE控制,读者可以清晰地看到HTML 5精简旧体制的努力取得. DOCTYPE主要用于在开始的情况下,XML于,用作叙述性说明XML同意使用的元素.物业和安排.起初HT ...
- 如何编写规范,灵活,稳定,高质量的HTML和css代码
黄金定律 永远遵循同一套编码规范,不管有多少人共同参与同一项目,一定要确保每一行代码都像是同一个人编写的. 语法: 1.用两个空格来代替制表符(tab);2.嵌套元素应当缩进一次(两个空格); 3.对 ...
- (转)rvm安装与常用命令
rvm是一个命令行工具,可以提供一个便捷的多版本ruby环境的管理和切换. https://rvm.io/ 如果你打算学习ruby/rails, rvm是必不可少的工具之一. 这里所有的命令都是再用户 ...
- Google HTML/CSS Style Guide
转自: http://google.github.io/styleguide/htmlcssguide.xml Google HTML/CSS Style Guide Revision 2.23 Ea ...
- File handling in Delphi Object Pascal(处理record类型)
With new users purchasing Delphi every single day, it’s not uncommon for me to meet users that are n ...
- 简介 jCanvas:当 jQuery遇上HTML5 Canvas
https://github.com/caleb531/jcanvas HTML5 可以直接在你的网页中使用 <canvas> 元素及其相关的 JavaScript API绘制的图形. 在 ...
- HTML5.dcloud.io-stream-app
dcloud.io提出的Stream App 本文仅仅是关于dcloud.io提出的SteamApp初探,所有内容请参考其官网. 1. Application promotion by scaning ...
- Html5 postMessage
解释: 跨文档消息传输Cross Document Messaging. 编写代码前注意判断浏览器是否支持Html5 实例: b页面向a页面发送消息. <!DOCTYPE> <htm ...
随机推荐
- share团队冲刺10
团队冲刺第十天 昨天:完善代码,美化界面 今天:整合全部代码,基本完成作品 问题:无
- PyQt5Day03--程序基本结构之面向对象版本+控件学习
1.程序基本结构之面向对象版本 (1)开发阶段(自己写好并测试)——设置为模版qto from PyQt5.Qt import * class Window(QWidget): def __init_ ...
- hdu 3483 矩阵乘法
这个题目上周对抗赛题目,搞了我好久 对数学这种不是很敏感 其实都不是自己想出来的,看其他的资料和博客的推导 还是有点难度的,反正我是推不出来 通过二项式定理的化简 有两个博客写得比较好 http:// ...
- UVALive 4794 Sharing Chocolate DP
这道题目的DP思想挺先进的,用状态DP来表示各个子巧克力块.原本是要 dp(S,x,y),S代表状态,x,y为边长,由于y可以用面积/x表示出来,就压缩到了只有两个变量,在转移过程也是很巧妙,枚举S的 ...
- Python心得--新手开发注意
1 注释 介绍 在大多数编程语言当中,注释都是一项非常有用的功能.我们开始编写的程序之中都只包含Python代码,但是随着程序越来越大.越来越复杂,就应在其中添加说明,对你解决问题的方法进行大致的阐 ...
- SQL基础教程(第2版)第2章 查询基础:2-1 SELECT语句基础
● 通过指定DISTINCT可以删除重复的行.● 为列设定显示用的别名. ■列的查询 通过 SELECT 语句查询并选取出必要数据的过程称为查询(query). 该 SELECT 语句包含了 SELE ...
- mac下使用opencv编译安装新模块contrib
opencv-4.0.1 opencv_contrib-4.0.1 提供ippicv下载链接: https://pan.baidu.com/s/1OIJRUqPqAtpMetku8qX36w cont ...
- 在阿里做了5年技术Leader,我总结出这些套路!
转自 51CTO技术栈 内容 团队建设 团队管理 团队文化 沟通与辅导 招聘与解雇 互联网公司的技术团队管理通常分为两个方向:技术管理和团队管理,互联网公司的技术 TL 与传统软件公司的 PM 还是有 ...
- css,js,jquery的载入方式和属性控制
本文章主要总结了css,js,jQuery在编写程序时的载入方式,与属性控制方式html和css共同组成了一个最基础的网页,js为标签样式提供动态效果 一,css的载入方式与属性控制 1.1,css引 ...
- day62-html-标签
前端 blog链接:http://www.cnblogs.com/liwenzhou/p/7988087.html 1.前端都有哪些内容? HTML CSS JavaScript jQuery Boo ...