这次在这里分享一些在编写网页文字时的一些常识。
把文字标题化——<h1>...<h6>(heading)
例子:
<h1>This is heading 1.</h1>
<h4>This is heading 1.</h4>
加入当滑鼠经过时会显示原文的缩写——<abbr>(abbreviation)
例子:
The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.
把文字粗体化——<b>(bold)
例子:
<b>This sentence is in bold.</b>
把文字斜化——<i>(italic)
例子:
<i>This sentence is in italic.</i>
在文字下划横线——<u>(underline)
例子:
<u>This sentence is underlined.</u>
把文字稍微大/小化——<big>, <small>
例子:
<big>The size is slightly bigger.</big>
<small>The size is slightly smaller</small>
把文字变成像是打字机的字体——<tt>(teletype)
例子:
<tt>This sentence is in teletype.</tt>
把文字的显示方向倒转——<bdo>(bidirectional override)
例子:
<bdo dir="ltr">I love UCPRO!</bdo>
<bdo dir="rtl">I love UCPRO!</bdo>
注:dir(direction)attribute的数值可以为ltr(left-to-right)或rtl(right-to-left)
让文字在新的一行开始——<br/>(break)
例子:
This is line 1.<br/>
This is line 2.
把文字分段——<p>(paragraph)
例子:
<p>This is paragraph 1.<p/>
<p>This is paragraph 2.<p/>
把文字显示为被引用的段落——<blockquote>
browser在文字的前和后加入一些空间。
例子:
<blockquote>I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO. I love UCPRO.</blockquote>
把文字或其它element显示在网页横中间——<center>
<center>This sentence is located at the center of the page.</center>
把原本的文字删掉然后写上新的文字的效果——<del>, <ins>——(delete,insert)
例子:
Original price is <del>RM 1,000</del> <ins>RM 500</ins>!
注:你也可以使用<strike>来代替<del>的效果。
在网页中加入横尺——<hr>(horizontal rule)
例子:
Before the rule.<hr/>After the rule.
注:你可以用align设定尺的呈现方向,size设定尺的高度,width设定尺的宽度。
保留文字原有的空格,段落和空行——<pre>(preformatted text)
例子:
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>
编写数学方程式时必用——<sub>, <sup>(subscript,superscript)
例子:
NaOH + HCl -> NaCl + H<sub>2</sub>O
a<sup>2</sup> = b<sup>2</sup> + c<sup>2</sup>
NaOH + HCl -> NaCl + H2O
a2 = b2 + c2
在文字前后加入开引号——<q>(quotation)
例子:
weewaawaa: <q>I love UCPRO!</q>
其它的不太重要,不过可以慢慢研究:
<em> Renders as emphasized text
<strong> Renders as strong emphasized text
<dfn> Defines a definition term
<code> Defines computer code text
<samp> Defines sample computer code
<kbd> Defines keyboard text
<var> Defines a variable part of a text
<cite> Defines a citation
Sunday, November 22, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment