<br>
: 文字換行
在編輯HTML文件時,按下鍵盤的Enter雖然可以讓內容在編輯器裡
換行,但是實際到瀏覽器執行結果的時候,卻還是會和前面的文字
連在一起。要在網頁中呈現換行的果,必須使用<br>標籤,只要在
任何需要換行的文字之前加上該標籤即可。
例子:
<p> : 插入一個空白列
原始碼
Hello!!
<BR>HTML
<BR>Homepage
結果
Hello!!
HTML
Homepage
編輯HTML文件時,即使在編輯器裡按兩下鍵盤的Enter,讓內容看
起來空了一行,但實際上還是會將所有內容連在一起,這時必須改
用<p>標籤才行。在網頁內容前後加上<p>,就可以在該段內容前面
加入一行空白列。
若果要使內容分別靠左,靠右或置中對齊,可在<p>標籤中加入
<p align="left">、<p align="right">、<p
align="center">
例子:
原始碼 | Here is the text for my
paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. <P>Here's the next paragraph. |
顯示結果 |
Here is the text for my paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. Here's the next paragraph. |
<center>,</center> : 讓網頁內容置中對齊
如果想讓內容置中對齊,可以使用<center>標籤,無論瀏覽器視窗大
小如何,網頁內容都會置中對齊。
例子:
原始碼 | <CENTER>My Homepage</CENTER>
<CENTER>HTML</CENTER> <CENTER>Hello</CENTER> |
結果 |
|