Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <p> <br> <img> <pre> <table> <tr> <td> <th> <strong> <em> <code> <tt> <h3> <h4> <blockquote> <cite> <sub> <sup> <small>
本網站允許使用 HTML 標籤。雖然學習 HTML 可能滿困難,但學習如何使用一小部份常用的 HTML "標籤" ,其實是很容易的。這個表格提供了本站可使用的 HTML 標籤的範例。
想瞭解更多資訊,請參考 W3C 的 HTML 規格表 ,或使用你常用的搜尋引擎,搜尋其他關於 HTML 的網站。
| 標籤說明 | 您輸入 | 您得到 | ||
|---|---|---|---|---|
| 錨點(anchor),用來製作通往其他頁面的連結。 | <a href="http://www.debian.org.hk">Debian HK</a> | Debian HK | ||
| 粗體 | <b>粗體</b> | 粗體 | ||
| 定義列表與其他 HTML列表類似。以 <dl> 開始定義列表,以 <dt> 開始定義列表項目,以 <dd> 開始定義說明。 | <dl> <dt>第一個詞彙</dt> <dd>第一個定義</dd> <dt>第二個詞彙</dt> <dd>第二個定義</dd> </dl> |
| ||
| 斜體 | <i>斜體</i> | 斜體 | ||
| 順序列表- 使用 <li> 來開始每個項目 | <ol> <li>第一個項目</li> <li>第二個項目</li> </ol> |
| ||
| 底線 | <u>底線</u> | 底線 | ||
| 無序列表——使用 <li> 開始每個項目 | <ul> <li>第一個項目</li> <li>第二個項目</li> </ul> |
| ||
| 在預設情況下,會自動加上段落標籤。如果要再加一個段落,可使用此標籤。 | <p>第一段。</p> <p>第二段。</p> | 第一段。 第二段。 | ||
| 在預設情況下,系統會自動加上換行符號,你可使用此標籤以多增加一行。這個標籤的用法跟其他 HTML 標籤不太一樣,它不使用一對開始/結束標記。另外,在標籤內加上一個 "/" ,則可相容於 XHTML1.0。 | 使用 <br /> 進行換行 | 使用 進行換行 | ||
| 目前沒有標籤 img 的說明。 | ||||
| 預先格式化 | <pre>預先格式化</pre> | 預先格式化 | ||
| 表格 | <table> <tr><th>表格的表頭</th></tr> <tr><td>表格的單格</td></tr> </table> |
| ||
| 粗體 | <strong>粗體</strong> | 粗體 | ||
| 強調 | <em>強調</em> | 強調 | ||
| 標示文字,用來顯示程式的原始碼。 | <code>編碼</code> | 編碼 | ||
| 目前沒有標籤 tt 的說明。 | ||||
| 標題 | <h3>副標題三</h3> | 副標題三 | ||
| 標題 | <h4>副標題四</h4> | 副標題四 | ||
| 區塊引言 | <blockquote>區塊引言</blockquote> | 區塊引言 | ||
| 引用 | <cite>引用</cite> | 引用 | ||
| 下標 | <sub>下標</sub> 文字 | 下標 文字 | ||
| 上標 | <sup>上標</sup> 文字 | 上標 文字 | ||
| 目前沒有標籤 small 的說明。 | ||||
大多數特殊字元都可以直接輸入,不會有問題。
但如果你碰到問題,可以嘗試使用 HTML character entities。一個通常的例子是用 &代表一個「和」符號 (&)。 完整的字元列表,請參見W3C的 HTML character entities。一些可用字元包括:
| 字元說明 | 您輸入 | 您得到 |
|---|---|---|
| 和 | & | & |
| 大於 | > | > |
| 小於 | < | < |
| 引號 | " | " |
BBCode allows you to specify formatting rules for your text, even if you are not allowed to use HTML in your posts. BBCode originated from the forum software named PHPBB, and this site has a special implementation of it.
In BBCode terms, you use "tags" to add formatting to your text. Every tag is enclosed in [ and ] brackets. If you want to mark some region in your text, you need to use an opening tag and a closing tag. Closing tags start with [/, as you will see in the examples below. If you mistype a tag or forget to close it, you will not get the desired formatting.
BBCode allows you to make some parts of your texts stand out from the context by adding [b]old, [i]talic, [u]nderlined and [s]trikeout formatting to them. The [color], [size] and [font] tags allow you to change the color, size and font of portions of the text you enclose with these tags. Both require a parameter (which colour, how big, what font) that is suffixed to the name of the tag by an equals sign (example below). You should not repeat the parameter in the closing tag!
You can specify any recognized color name (red, blue, green, white, etc.) or a hexadecimal color value (#CDCDCD, #FFFFFF, etc.) as the parameter of a [color] tag. The [size] tag allows you to set the font size between 6 and 48, 6 being the smallest size. Note that using very large text is considered by many to be annoying, and it is seldom a good idea to try to attract more attention to your post in this way. The [font] tag can be set to any valid font face, such as Arial, Arial Black, Courier, Courier New, Helvetica, Impact, Times New Roman, Verdana, etc.
| usage | display |
|---|---|
| I [b]need to do[/b] this by the weekend | I need to do this by the weekend |
| John said that [i]we should[/i] ask her | John said that we should ask her |
| I [u]would not like to[/u] offend you | I would not like to offend you |
| Let's correct this [s]mispelled[/s] misspelled word | Let's correct this |
| Jane was at [color=blue]the coast[/color] | Jane was at the coast |
| Joe was in [color=#FF0000]the forest[/color] | Joe was in the forest |
| You said: [size=30]HEY![/size] | You said: HEY! |
| She said: [font=Courier]What?[/font] | She said: What? |
You have multiple options to specify links to other destinations in your posts.
URLs (Uniform Resource Locators) starting with "www" or "ftp" (eg. www.example.com) are automatically recognized and replaced with links. You can also use the [url] tag with a parameter to specify a link with meaningful text to click on. If you use the url tag without the parameter, the enclosed text is assumed to be a URL, and a link is created to that destination.
Email addresses in posts are also automatically converted to email links. For compatibility with common BBCode implementations, an [email] tag is provided.
| usage | display |
|---|---|
| For more examples, visit www.example.com | For more examples, visit www.example.com |
| For more examples, visit http://example.com | For more examples, visit http://example.com |
| If you have questions ask me at joe@example.com | If you have questions ask me at joe@example.com |
| If you have questions ask me at [email]joe@example.com[/email] | If you have questions ask me at joe@example.com |
| We use [url=http://example.com/]the example site[/url] in these examples | We use the example site in these examples |
| We use [url]http://example.com/[/url] in these examples | We use http://example.com/ in these examples |
The [img] tag allows you to display an image in your post. You need to specify a URL to the image, so it needs to be accessible somewhere on the internet. Beware of adding very large images to your text, or the page will load very slowly!
If you enclose a URL in an [img] tag, then it will
be replaced with code to display the image. For example A good
screenshot: [img]http://example.com/screenshot.png[/img]
will show you the screenshot (if it exists).
You can also specify the desired display dimensions of the image by
adding a dimension parameter to the [img] tag. A
good screenshot: [img=640x480]http://example.com/screenshot.png[/img]
will display the image in 640x480 (though the full image will be
downloaded). Do not use this to show a thumbnail of an image!
You are free to link an image to an external destination by enclosing
the [img] tag with a [url] tag: See
[url=http://example.com][img]http://example.com/screenshot.png[/img][/url].
The simplest list type is the unordered list, which means that there is no numbering applied to the elements. You can make such a list by enclosing the list elements in [list] opening and closing tags. Specify the start of one element with the [*] list element marker, which has no closing tag pair.
To create an ordered list, you should add a parameter to the [list] list tag specifying what type of ordered list you would like to see. The possible parameters are "i", "I", "1", "a", "A", "c", "d" and "s" which all correspond to the display of the first list element.
| usage | display |
|---|---|
I love [list] [*]Oranges [*]Apples [*]Bananas [/list] |
I love
|
I love [list=I] [*]Oranges [*]Apples [*]Bananas [/list] |
I love
|
I love [list=1] [*]Oranges [*]Apples [*]Bananas [/list] |
I love
|
You can use the [code] tag to add an inline fixed-width formatted part or to add a block of (usually program) code. If there is any newline present between the opening and closing tags, then a block will be displayed.
Similarly, the [php] tag can be used to post PHP code. PHP code will automatically be syntax highlighted for easier readability.
| usage | display |
|---|---|
| Edit your [code]robots.txt[/code] file | Edit your robots.txt file |
|
An HTML title example: [code] <head> <title>Page Title</title> </head> [/code] |
An HTML title example:
<head>
|
|
Some PHP code: [php] <?php function hello() { echo "Hello World!"; } ?> [/php] |
Some PHP code:
<?php
|
You can also set the alignment of the text by using [left], [right] and [center] tags. The [float] tag can be used to place floating boxes in the text (especially handy for images). You can specify the direction of the floating with [float=left] and [float=right]. The [justify] tag can be used justify text on both sides of the page.
It is possible to quote something that has already been posted, by just putting [quote][/quote] tags around it. To quote a specific person, use something like [quote=John]. Quote tags can be nested.
The [sub] and [sup] tags can be used to add subscript and superscript text. For example, H[sub]2[/sub]O gives H2O, while X[sup]3[/sup] gives X3.
The [acronym] tag allow you to identify text as an acronym and provide a description when users move their mouse over the tag. For example, [acronym=Structured Query Language]SQL[/acronym] produces SQL.
The [abbr] tag allow you to identify text as an abbreviation and provide a description when users move their mouse over the tag. For example, [abbr=World Wide Web]WWW[/abbr] produces WWW.
The [notag] tags prevent text inside the tags from being parsed. This allows you to give examples of BBcode and not have it converted to HTML. For example: [notag]These [b]tags[/b] are not rendered[/notag] will produce "These [b]tags[/b] are not rendered".
The [hr] tag draws a horizontal line across the page. Handy for separating chunks of text.
You can apply more than one formatting specification to a portion of some
text. I was at [b][i]the coast[/i][/b] will be
rendered as I was at the coast.
Make sure that you take care of the proper order of the opening and closing tags. You should close the tags in the opposite order in which you opened them. Otherwise you might get very strange rendering results. Also check your post with the preview function before submitting it, in case there are formatting errors due to improper BBCode usage.