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 &amp; 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 &amp; 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>

Author: mlhy

Created: 2015-10-09 五 18:31

Emacs 24.5.1 (Org mode 8.2.10)

时间: 2024-08-04 18:22:32

HTML5 Fundamental Syntax的相关文章

免费的HTML5连载来了《HTML5网页开发实例详解》连载(三)DOCTYPE和字符集

在2.1.2节中通过新老DOCTYPE的对比,读者可以清晰地看到HTML 5在精简旧有结构上做出的努力.DOCTYPE在出现之初主要用于XML中,用作描述XML允许使用的元素.属性和排列方式.起初HTML借鉴了XML中DOCTYPE的使用方法,并赋予了新用法,如大家熟知的触发浏览器的标准模式.假使在制作一张页面时,没有设定DOCTYPE,则浏览器会以怪异模式状态进行处理(即Quirks模式),该模式与标准模式在盒模型.样式.布局等都存在较大差异.因此,DOCTYPE在制作页面时是不可或缺的部分.

JavaScript中的定时器

定时器 1.setTimeout 这个方法用于在指定的毫秒数之后执行某个函数,返回定时器的句柄 混合的 setTimeout()方法设置一个定时器,该定时器在定时器到期后执行一个函数或指定的一段代码. 语法 let timeoutID = window.setTimeout(func[, delay, param1, param2, ...]); let timeoutID = scope.setTimeout(code[, delay]); let timeoutID = window.set

如何编写规范,灵活,稳定,高质量的HTML和css代码

黄金定律 永远遵循同一套编码规范,不管有多少人共同参与同一项目,一定要确保每一行代码都像是同一个人编写的. 语法: 1.用两个空格来代替制表符(tab);2.嵌套元素应当缩进一次(两个空格); 3.对于属性的定义,确保全部使用双引号,绝不要使用单引号; 4.不要在自闭合元素的尾部添加斜线--HTML5规范(https://dev.w3.org/html5/spec-author-view/syntax.html#syntax-start-tag)中明确说明这是可选的; 5.不要省略可选的结束标签

(转)rvm安装与常用命令

rvm是一个命令行工具,可以提供一个便捷的多版本ruby环境的管理和切换. https://rvm.io/ 如果你打算学习ruby/rails, rvm是必不可少的工具之一. 这里所有的命令都是再用户权限下操作的,任何命令最好都不要用sudo. rvm安装 $ curl -L get.rvm.io | bash -s stable $ source ~/.bashrc $ source ~/.bash_profile 修改 RVM 的 Ruby 安装源到国内的 淘宝镜像服务器,这样能提高安装速度

基于HTML5的PACS--HTML5图像处理

在此之前,此系统是结合DICOM的WADO标准,在浏览器里通过javascript操作返回的JPG图片.这种服务器端解析,客户端展现的方式,对实现图像的移动.缩放.旋转.测量等图像操作能够实现实时的交互.但这种方式存在着几个弊端: 1.获取图像上的CT值(钙化值)信息的时候,要频繁的和服务器进行交互. 2.调整图像的窗宽窗位或者对图像进行反色,也要和服务器进行频繁的交互. 3.对图像进行测量(长方形测量,椭圆测量等)只能获取到面值和周长的简单的信息,这对于医生的诊断没多大的用处,实际运用中需要知

angular controller as syntax vs scope

今天要和大家分享的是angular从1.2版本开始带来了新语法Controller as.再次之前我们对于angular在view上的绑定都必须使用直接的scope对象,对于controller来说我们也得必须注入$scope这个service.如下: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 angular.module("app",[]) .controller("demoController",["$scope&qu

基于HTML5的PACS--HTML5图像处理(7)实现客户端JS调整窗宽窗位

仅提供参考和学习,代码仅为了指明个思路,转载请注明出处. 要查看此系统更多的图像处理功能请参考: 区域医疗移动医疗影像解决方案--基于HTML5的PACS--HTML5图像处理 在此之前,此系统是结合DICOM的WADO标准,在浏览器里通过javascript操作返回的JPG图片.这种服务器端解析,客户端展现的方式,对实现图像的移动.缩放.旋转.测量等图像操作能够实现实时的交互.但这种方式存在着几个弊端: 1.获取图像上的CT值(钙化值)信息的时候,要频繁的和服务器进行交互. 2.调整图像的窗宽

Mobile HTML5

Book Description Build kickass websites and applications for all mobile (and non-mobile) platforms by adding HTML5 and CSS3 to your web development toolkit. With this hands-on book, you’ll learn how to develop web apps that not only work on iOS, Andr

Html5 本地文件读取 API 研究使用过程中的意外发现 - MDN

太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作. 补充: 终于可以读出肉的眼能看懂的人类文字了!!! 经在 safari 7.0.4(9537.76.4) 测试,即使关闭 WebGL 支持,Fil