# HTML 文本格式化
HTML 文本格式化 HTML 文本格式化 加粗文本 斜體文本 電腦自動輸出 這是 下標 和 上標 嘗試一下 ? HTML 格式化標簽 HTML 使用標簽 與 對輸出的文本進行格式, 如:粗體 or 斜體 這些HTML標簽被稱為格式化標簽(請查看底部完整標簽參考手冊)。 通常標簽 替換加粗標簽
* * *
## 實例
~~~
<!DOCTYPE?html>
<html>
<head>?
<meta?charset="utf-8">?
<title>php中文網(php.cn)</title>?
</head>?
<body>
<b>加粗文本</b><br><br>
<i>斜體文本</i><br><br>
<code>電腦自動輸出</code><br><br>
這是?<sub>?下標</sub>?和?<sup>?上標</sup>
</body>
</html>
~~~
[運行實例 ?](https://www.php.cn/html/html-formatting.html#)
點擊 "運行實例" 按鈕查看在線實例
* * *
## HTML 格式化標簽
HTML 使用標簽 與 對輸出的文本進行格式, 如:**粗體**or*斜體*
這些HTML標簽被稱為格式化標簽(請查看底部完整標簽參考手冊,亦可查詢[HTML編程詞典](http://www.php.cn/dic/11.html))。
通常標簽 <strong> 替換加粗標簽 <b> 來使用, <em> 替換 <i>標簽使用。然而,這些標簽的含義是不同的:<b> 與<i> 定義粗體或斜體文本。<strong> 或者 <em>意味著你要呈現的文本是重要的,所以要突出顯示。現今所有主要瀏覽器都能渲染各種效果的字體。不過,未來瀏覽器可能會支持更好的渲染效果。
在線實例
[文本格式化](http://www.php.cn/code/30202.html)
此例演示如何在一個 HTML 文件中對文本進行格式化
[預格式文本](http://www.php.cn/code/30203.html)
此例演示如何使用 pre 標簽對空行和空格進行控制。
["計算機輸出"標簽](http://www.php.cn/code/30204.html)
此例演示不同的"計算機輸出"標簽的顯示效果。
[地址](http://www.php.cn/code/30205.html)
此例演示如何在 HTML 文件中寫地址。
[縮寫和首字母縮寫](http://www.php.cn/code/30206.html)
此例演示如何實現縮寫或首字母縮寫。
[文字方向](http://www.php.cn/code/30207.html)
此例演示如何改變文字的方向。
[塊引用](http://www.php.cn/code/30208.html)
此例演示如何實現長短不一的引用語。
[刪除字效果和插入字效果](http://www.php.cn/code/30209.html)
此例演示如何標記刪除文本和插入文本。
* * *
## HTML 文本格式化標簽
| 標簽 | 描述 |
| :-- | :-- |
| [](http://www.php.cn/dic/html/b.html) | 定義粗體文本 |
| [](http://www.php.cn/tags/tag-em.html) | 定義著重文字 |
| [](http://www.php.cn/dic/html/i.html) | 定義斜體字 |
| [](http://www.php.cn/dic/html/small.html) | 定義小號字 |
| [](http://www.php.cn/dic/html/strong.html) | 定義加重語氣 |
| [](http://www.php.cn/dic/html/sub.html) | 定義下標字 |
| [](http://www.php.cn/dic/html/sup.html) | 定義上標字 |
| [](http://www.php.cn/dic/html/ins.html) | 定義插入字 |
| [](http://www.php.cn/dic/html/del.html) | 定義刪除字 |
## HTML "計算機輸出" 標簽
| 標簽 | 描述 |
| :-- | :-- |
| [](http://www.php.cn/tags/tag-code.html) | 定義計算機代碼 |
| [](http://www.php.cn/tags/tag-kbd.html) | 定義鍵盤碼 |
| [](http://www.php.cn/tags/tag-samp.html) | 定義計算機代碼樣本 |
| [](http://www.php.cn/tags/tag-var.html) | 定義變量 |
| [](http://www.php.cn/dic/html/pre.html) | 定義預格式文本 |
## HTML 引文, 引用, 及標簽定義
| 標簽 | 描述 |
| :-- | :-- |
| [](http://www.php.cn/dic/html/abbr.html) | 定義縮寫 |
| [](http://www.php.cn/dic/html/address.html) | 定義地址 |
| [](http://www.php.cn/dic/html/bdo.html) | 定義文字方向 |
| [](http://www.php.cn/dic/html/blockquote.html) | 定義長的引用 |
| [](http://www.php.cn/tags/tag-q.html) | 定義短的引用語 |
| [](http://www.php.cn/dic/html/cite.html) | 定義引用、引證 |
| [](http://www.php.cn/tags/tag-dfn.html) |
定義一個定義項目。
|