我是按照 W3school 上面的教程學習的,個人覺得教程很不錯,每節都有小練習。下面記錄的是我自己手敲的代碼——雖然有些書不主張初學者手寫,但我覺得因為沒有基礎,自己寫寫還是有好處的。
<html>
<body bgcolor="yellow">
<h1 align="center">This is heading 1</h1>
<h2 align = "left">This is heading 1</h2>
<h3 align = "right">This is heading 1</h3>
<h4>This is heading 1</h4>
<h5>This is heading 1</h5>
<h6>This is heading 1</h6>
<!--<h7>This is heading 1</h7>-->
<!--再來個注釋,試一下效果 -->
<p>This is the first paragraph
</p>
<hr />這是鏈接區域
<a href="https://www.baidu.com">This is baidu link</a>
<br/>
<a href="https://www.w3school.com.cn">This is w3school link</a>
<hr />這是圖片區域
<img src = "https://img.t.ifeng.com/201010/22/12/96x96_1758293e995c.jpg" />
<hr />這是表格區域
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<hr />換行功能
<p>這句話<br />在這裡換行
</p>
<p>
這個段落 有很多
<br />空行
<br />或者空格
<br />但是浏覽器自動 忽略
<br />了它們
</p>
<pre>
這是預格式文本
可以顯示空行
和空格
還有代碼
</pre>
<pre>
while(true)
{
sum=a+b;
return sum;
cout<<sum;
}
</pre>
</body>
</html>
<html>
<body>
<b>This text is bold</b>
<strong>This text is strong</strong>
<big>This text is big</big>
<small>This text is small</small>
<em>This text is emphasized</em>
<i>This text is italic</i>
This text contains<sub>下標</sub>
This text contains<sup>上標</sup>
<hr />
<pre>
這是預格式文本
哈哈
可以輸出空格
空行吧
</pre>
<code>
while(true)
{
computer code;
}
</code>
<kbd>keyboard input</kbd>
<samp>Sample text</samp>
<var>Computer variable</var>
<hr />
地址練習:
<address>
天津市SHUDIP<br />
FERT R<br />
ABC(收)<br />
郵編:123456
</address>
<hr />縮寫練習
<abbr title = "etcetera">etc.</abbr>
<acronym title = "World Wide Web">www.</acronym>
<hr />文字方向練習
<bdo dir="rtl">Here is some text</bdo>
<hr />塊的引用練習
這是長引用
<blockquote>這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用
這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用。這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用
這是長引用.這是長引用.這是長引用.這是長引用.這是長引用.這是長引用</blockquote>
這是短引用
<q>短引用哇,短引用</q>
<hr />刪除或添加文字效果練習
<p>一打有<del>二十</del><ins>十二</ins>個哦</p>
</body>
</html>
內容確實超級簡單,但只要堅持一節節敲下來,對標簽的手感自然就出來了。堅持!