一、HTML标签

标签很全的参考网站:

http://htmling.cn/html/indexm.html

主要通过实例来记忆:

 1 <html>
 2     <head>
 3         <title><h1>HTML basic tag</h1></title>
 4     </head>
 5     <body>
 6         <h1>This is a heading.</h1>
 7         <p>This is a paragraph.</p>
 8         <p>This is another paragraph</p>
 9         <font size="+1" color="blue" face="Times">This is font size+1 based on default size.</font><br>
10         This displayed as <i>italic</i> <br>
11         <a href="http://www.cnblogs.com/sevennight/">This is a link.</a><br>
12         <img src="http://flowerinfo.org/wp-content/gallery/rose-flowers/rose-flower-14.jpg" width="300" height="200"/>
13     </body>
14 </html>

 效果如下:

HTML basic tag

This is a heading.

This is a paragraph.

This is another paragraph

This is font size+1 based on default size.
This displayed as italic
This is a link.

1 <marquee behavior="scroll" direction="right" scrolldelay="40" bgcolor="lightblue"         
2 vspace="40">
3 <h2 style="margin:10px">roll...</h2>
4 </marquee>

<hr/>: 创建水平线

二、HTML文本格式化

2.1

 1 <html>
 2     <body>
 3         <b>This text is bold</b><br />
 4         <strong>This text is strong</strong><br />
 5         <big>This text is big</big><br />
 6         <em>This text is emphasized</em><br />
 7         <i>This text is italic</i><br />
 8         <small>This text is small</small><br />
 9         This text contains<sub>subscript</sub><br />
10         This text contains<sup>superscript</sup>
11     </body>
12 </html>

 

 效果如下:

This text is bold
This text is strong
This text is big
This text is emphasized
This text is italic
This text is small
This text contains subscript
This text contains superscript


2.2  预格式文本
因为在html代码中多个空格和多行也视为一个空格,而pre标签可以保留空格和换行,适合显示源代码。

 

 比如:

1 <pre>
2     eg.
3     <pre>pre tag contaiins the namespace and ctrl style..</pre>
4 </pre>

结果:

eg.
pre tag contaiins the namespace and ctrl style.

2.3 缩写和首字母的缩写

 1 <html>
 2 
 3 <body>
 4 
 5 <abbr title="etcetera">etc.</abbr>
 6 <br />
 7 <acronym title="World Wide Web">WWW</acronym>
 8 
 9 <p>在某些浏览器中,当您把鼠标移至缩略词语上时,title 可用于展示表达的完整版本。</p>
10 
11 <p>仅对于 IE 5 中的 acronym 元素有效。</p>
12 
13 <p>对于 Netscape 6.2 中的 abbr 和 acronym 元素都有效。</p>
14 
15 </body>
16 </html>

结果:

etc.
WWW

在某些浏览器中,当您把鼠标移至缩略词语上时,title 可用于展示表达的完整版本。

仅对于 IE 5 中的 acronym 元素有效。

对于 Netscape 6.2 中的 abbr 和 acronym 元素都有效。

 


2.4 长引用和短引用

1 这是长引用:
2 
3 <blockquote>这是长引用。blockquote>
4 
5 这是短引用:
6 
7 <q>这是短引用。</q>

 

这是长引用:

这是长引用。

这是短引用: 这是短引用。



2.5 删除文本和下划线文本

<del>删除文本</del>
<ins>下划线文本</ins>

 

删除文本 下划线文本


 以下引用自W3Cschool:

文本格式化标签

标签描述
<b> 定义粗体文本。
<big> 定义大号字。
<em> 定义着重文字。
<i> 定义斜体字。
<small> 定义小号字。
<strong> 定义加重语气。
<sub> 定义下标字。
<sup> 定义上标字。
<ins> 定义插入字。
<del> 定义删除字。
<s> 不赞成使用。使用 <del> 代替。
<strike> 不赞成使用。使用 <del> 代替。
<u> 不赞成使用。使用样式(style)代替。

“计算机输出”标签

标签描述
<code> 定义计算机代码。
<kbd> 定义键盘码。
<samp> 定义计算机代码样本。
<tt> 定义打字机代码。
<var> 定义变量。
<pre> 定义预格式文本。
<listing> 不赞成使用。使用 <pre> 代替。
<plaintext> 不赞成使用。使用 <pre> 代替。
<xmp> 不赞成使用。使用 <pre> 代替。

 

引用、引用和术语定义

标签描述
<abbr> 定义缩写。
<acronym> 定义首字母缩写。
<address> 定义地址。
<bdo> 定义文字方向。
<blockquote> 定义长的引用。
<q> 定义短的引用语。
<cite> 定义引用、引证。
<dfn> 定义一个定义项目。
posted on 2012-11-08 17:05  阳光的七夜  阅读(521)  评论(0编辑  收藏  举报