HTML:http://www.w3school.com.cn/htm
<html>
<body>
<h1>國學講堂</h1>
<p>紅樓夢之釵黛合一</p>
<br /> //相當於換行,且空出一行
<br> //與<br />功能相同,但是,即使 <br> 在所有瀏覽器中都是有效的,但使用 <br /> 其實是更長遠的保障。
<p>時間:2010年7月23日</p>
<p>地點:經信大講堂</p>
<p>主講人:蔡義江</p>
</body>
</html>
//輸出:
國學講堂
紅樓夢之釵黛合一
時間:2010年7月23日
地點:經信大講堂
主講人:蔡義江
“欲格式文本”:
<html>
<body>
<pre>
這是
預格式文本。
它保留了 空格
和換行。
</pre>
<p>pre 標籤很適合顯示計算機代碼:</p>
<pre>
for i = 1 to 10
print i
i++
</pre>
</body>
</html>
輸出:
這是 預格式文本。 它保留了 空格 和換行。
pre 標籤很適合顯示計算機代碼:
for i = 1 to 10 print i i++ 文本倒顯示: <html>
<body>
<bdo dir="rtl">
Here is some Hebrew text
</bdo>
</body>
</html>
輸出 Here is some Hebrew text 在新的瀏覽器中打開鏈接: <html>
<body>
<a href="/example/html/lastpage.html" target="_blank">最後一頁</a>
<p>如果把鏈接的 target 屬性設置爲 "_blank",該鏈接會在新窗口中打開。
</p>
</body>
</html>
輸出:最後一頁
如果把鏈接的 target 屬性設置爲 "_blank",該鏈接會在新窗口中打開。
表格中的空單元格
在大多數瀏覽器中,沒有內容的表格單元顯示得不太好。
<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td></td>
</tr>
</table>
在瀏覽器顯示如下:
row 1, cell 1 | row 1, cell 2 |
row 2, cell 1 |
注意:這個空的單元格的邊框沒有被顯示出來。(不過 Mozilla Firefox 可以將整個邊框顯示出來。)爲了避免這種情況,在空單元格中添加一個空格佔位符,就可以將邊框顯示出來。
<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td> </td>
</tr>
</table>
在瀏覽器中顯示如下:
row 1, cell 1 | row 1, cell 2 |
row 2, cell 1 |