学习笔记—HTML(3)
2017-12-11 11:58
218 查看
描述列表:
这些列表的目的是标记一组项目及其相关描述,例如术语和定义, 问题和答案等。
描述列表 (description list) 使用与其他列表类型不同的闭合标签—
此外,每一项都用
term) 元素闭合。每个描述都用
description) 元素闭合。让我们来完成下面的标记例子:
浏览器的默认样式会将描述列表的描述部分(description description)渲染成和描述术语(description terms)之间有一些缩进。
如果一个块级内容(一个段落,多个段落,一个列表等)从其他地方被引用,你应该把它用
行内元素用同样的方式工作,除了使用
浏览器默认将其作为普通文本放入引号内表示引用,就像下面:
The quote element —
for short quotations that don't require paragraph breaks.(<q>元素旨在用于不需要分段的短引用)
另一个你在web上看到的相当常见的元素是
HTML有个用于标记联系地址的元素——
但要记住的一点是,
当你使用日期、化学方程式、和数学方程式时会偶尔使用上标和下标,所以它们有正确的意义。
有大量的HTML元素可以来标记计算机代码:
用于标记计算机通用代码。
用于标记固定宽度的文本块,其中保留空格(通常是代码块)。
用于标记具体变量名。
用于标记输入电脑的键盘(或其他类型)输入。
用于标记计算机程序的输出。
HTML 还支持将时间和日期标记为可供机器识别的格式的
(文章内容摘自MDN、菜鸟教程等网站)
这些列表的目的是标记一组项目及其相关描述,例如术语和定义, 问题和答案等。
描述列表 (description list) 使用与其他列表类型不同的闭合标签—
<dl>;
此外,每一项都用
<dt>(description
term) 元素闭合。每个描述都用
<dd>(description
description) 元素闭合。让我们来完成下面的标记例子:
<dl> <dt>soliloquy</dt> <dd>In drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.)</dd> <dt>monologue</dt> <dd>In drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present.</dd> <dt>aside</dt> <dd>In drama, where a character shares a comment only with the audience for humorous or dramatic effect. This is usually a feeling, thought or piece of additional background information.</dd> </dl>
浏览器的默认样式会将描述列表的描述部分(description description)渲染成和描述术语(description terms)之间有一些缩进。
如果一个块级内容(一个段落,多个段落,一个列表等)从其他地方被引用,你应该把它用
<blockquote>元素包裹起来表示,并且在
cite属性里用URL来指向引用的资源。
行内元素用同样的方式工作,除了使用
<q>元素。例如,下面的标记包含了从MDN
<q>页面的引用:
<p>The quote element — <code><q></code> — is <q cite="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q">intended for short quotations that don't require paragraph breaks.</q></p>
浏览器默认将其作为普通文本放入引号内表示引用,就像下面:
The quote element —
<q>— is intended
for short quotations that don't require paragraph breaks.(<q>元素旨在用于不需要分段的短引用)
另一个你在web上看到的相当常见的元素是
<abbr>——它常被用来包裹一个缩略语或缩写,并且提供缩写的解释(包含在
title属性中)。
HTML有个用于标记联系地址的元素——
<address>。它仅仅包含你的联系地址,例如:
<address> <p>Chris Mills, Manchester, The Grim North, UK</p> </address>
但要记住的一点是,
<address>元素是为了标记编写HTML文档的人的联系方式,而不是任何其他的地址。
当你使用日期、化学方程式、和数学方程式时会偶尔使用上标和下标,所以它们有正确的意义。
<sup>和
<sub>元素可以解决这样的问题。例如:
<p>My birthday is on the 25<sup>th</sup> of May 2001.</p> <p>Caffeine's chemical formula is C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>.</p> <p>If x<sup>2</sup> is 9, x must equal 3 or -3.</p>
表示计算机代码Edit
有大量的HTML元素可以来标记计算机代码:<code>:
用于标记计算机通用代码。
<pre>:
用于标记固定宽度的文本块,其中保留空格(通常是代码块)。
<var>:
用于标记具体变量名。
<kbd>:
用于标记输入电脑的键盘(或其他类型)输入。
<samp>:
用于标记计算机程序的输出。
HTML 还支持将时间和日期标记为可供机器识别的格式的
<time>元素。例如:
<time datetime="2016-01-20">20 January 2016</time>
(文章内容摘自MDN、菜鸟教程等网站)
相关文章推荐
- HTML学习笔记1.8-添加图片
- 学习笔记2017.07.05-day3,am-HTML表格
- HTML学习笔记(三)链接
- lucene学习笔记 (转载:http://www.cnblogs.com/bysshijiajia/articles/1237466.html)
- HTML学习笔记(四)图像
- 2012-04-27 HTML 基础学习笔记(1)
- 【Spring学习笔记-MVC-18.1】Spring MVC实现RESTful风格-同一资源,多种展现:xml-json-html
- HTML&CSS基础学习笔记13—无序列表
- HTML5+Bootstrap 学习笔记 1
- HTML学习笔记之列表控件 无序列表 ul(Unordered List) 、有序列表 ol(Ordered List) 、定义列表 dl(Definition List)
- HTML&CSS基础学习笔记1.22-表单的文本域和下拉列表
- HTML语言学习笔记之四
- HTML 学习笔记(一)<h1>、<hr />、<p>、<ol><li>、<ul><li>、<dl><dt><dd>、 、<a name="abc">、href="#abc"、mailto
- ASP.Net MVC开发基础学习笔记(2):HtmlHelper与扩展方法
- html学习笔记(3)-CSS padding margin border属性详解
- HTML/CSS学习笔记
- Html 语法学习笔记二
- web开发-html和css开发实例-学习笔记三
- Android 数字签名学习笔记 (转http://www.cnblogs.com/feisky/archive/2010/01/17/1650076.html)
- GTK+图形化应用程序开发学习笔记(一)—概述 转载:http://blog.chinaunix.net/u/22935/showart_308184.html