HTML 表格
表格中常用標簽、屬性及意義
代碼 | 意義 |
---|---|
<tr> |
橫行 |
<td> |
單元格數據 |
<th> |
表頭 |
<caption> |
表格標題 |
<colgroup> |
定義表格列的組 |
<col> |
定義用于表格列的屬性 |
<thead> |
頁眉 |
<tbody> |
主體 |
<tfoot> |
頁腳 |
colspan="y" |
跨y行 |
rowspan="y" |
跨y列 |
border="y" |
表格邊框厚度 |
cellpadding="y" |
單元格邊距,放于<table> 下 |
cellspacing="y" |
單元格間距,放于<table> 下 |
HTML 列表
-
HTML無序列表
<ul> <li>Coffee</li> <li>Milk</li> </ul>
調整列表原點類型:`style="list-style-type:cirle,disc,square"
- HTML 有序列表
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
調整列表編號類型:type="A,a,Ⅰ,i"
-
HTML 自定義列表
<dl> <dt>Coffee</dt> <dd>- black hot drink</dd> <dt>Milk</dt> <dd>- white cold drink</dd> </dl>
HTML布局
用
div
布局
詳細內容見于http://www.runoob.com/html/html-layouts.html由于使用
stable
布局不是主流,故不再列出。
HTML 表單和輸入
常用標簽<form> <input>
,常用屬性type
-
文本域
<form> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"> </form>
-
密碼字段
<form> Password: <input type="password" name="pwd"> </form>
-
單選按鈕(Radio Buttons)
<form> <input type="radio" name="sex" value="male">Male<br> <input type="radio" name="sex" value="female">Female </form>
-
復選框(Checkboxes)
<form> <input type="checkbox" name="vehicle" value="Bike">I have a bike<br> <input type="checkbox" name="vehicle" value="Car">I have a car </form>
-
提交按鈕
<form name="input" action="html_form_action.php" method="get"> Username: <input type="text" name="user"> <input type="submit" value="Submit"> </form>
-
下拉列表
<form action=""> <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select> </form>
HTML框架
<iframe src="demo_iframe.htm" width="200" height="200"></iframe>
<iframe src="demo_iframe.htm" frameborder="0"></iframe>
- 使用iframe來顯示目標鏈接頁面
<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a target="iframe_a">RUNOOB.COM</a></p>