2008-04-22

HTML 文本格式化实例

关键字: html
文本格式化

b,strong标签粗体,br换行,big字体变大,em,i斜体,small字体变小,sub向下靠子字符串,sup向上靠子字符串
<html>

<body>

<b>This text is bold</b>

<br>

<strong>This text is strong</strong>

<br>

<big>This text is big</big>

<br>

<em>This text is emphasized</em>

<br>

<i>This text is italic</i>

<br>

<small>This text is small</small>

<br>

This text contains
<sub>subscript</sub>

<br>

This text contains
<sup>superscript</sup>

</body>
</html>


预格式文本
pre标签对空行和空格敏感
<html>

<body>

<pre>
This is
preformatted text.
It preserves      both spaces
and line breaks.
</pre>

<p>The pre tag is good for displaying computer code:</p>

<pre>
for i = 1 to 10
     print i
next i
</pre>

</body>
</html>


“计算机输出”标签

<html>

<body>

<code>Computer code</code>
<br>
<kbd>Keyboard input</kbd>
<br>
<tt>Teletype text</tt>
<br>
<samp>Sample text</samp>
<br>
<var>Computer variable</var>
<br>

<p>
<b>Note:</b> These tags are often used to display computer/programming code.
</p>

</body>
</html>


地址
<html>

<body>

<address>
Donald Duck<br>
BOX 555<br>
Disneyland<br>
USA
</address>

</body>
</html>


缩写和首字母缩写
<html>

<body>

<abbr title="United Nations">UN</abbr>
<br>
<acronym title="World Wide Web">WWW</acronym>

<p>The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or abbreviation.</p>

<p>This only works for the acronym element in IE 5.</p>

<p>This works for both the abbr and acronym element in Netscape 6.2.</p>

</body>
</html>


文字方向
<html>

<body>

<p>
If your browser supports bi-directional override (bdo), the next line will be written from the right to the left (rtl):
</p>

<bdo dir="rtl">
Here is some Hebrew text
</bdo>

</body>
</html>


块引用
<html>

<body>

Here comes a long quotation:
<blockquote>
This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.
</blockquote>

Here comes a short quotation:
<q>
This is a short quotation
</q>

<p>
With the block quote element, the browser inserts line breaks and margins, but the q element does not render as anything special.
</p>

</body>
</html>


删除字效果和插入字效果
<html>

<body>

<p>
a dozen is 
<del>twenty</del> 
<ins>twelve</ins> 
pieces
</p>

<p>
Most browsers will overstrike deleted text and underline inserted text.
</p>

<p>
Some older browsers will display deleted or inserted text as plain text.
</p>

</body>
</html>
评论
发表评论

您还没有登录,请登录后发表评论

t0uch
搜索本博客
最近加入圈子
存档
最新评论