html經常使用標籤
<h1> </h1>
<h2> </h2>
<h3> </h3>
...
<p> </p> //段落標籤
<hr /> //水平線標籤
<br /> //換行標籤
<div> </div>
<span> </span>
<img src="url" /> //圖像標籤
<a href="" target="self"> </a> //連接標籤
<!-- 註釋語句 --> //註釋標籤
相對路徑 | 絕對路徑
表格標籤
<table>
<tr>
<th>表頭</th>
...
</tr>
<tr>
<td>單元格內的文字</td>
...
</tr>
...
</table>
無序列表
<ul>
<li> </li>
<li> </li>
<li> </li>
...
</ul>
//有序列表
<ol>
<li> </li>
<li> </li>
<li> </li>
...
</ol>
//自定義列表
<dl>
<dt>名詞1</dt>
<dd>名詞1解釋1</dd>
<dd>名詞1解釋2</dd>
...
</dl>
表單標籤
<input type="屬性值" value="" name="">
type |
text |
單行文本輸入框 |
type |
password |
密碼輸入框 |
type |
radio |
單選按鈕 |
type |
checkbox |
複選框 |
type |
button |
普通按鈕 |
type |
submit |
提交按鈕 |
type |
reset |
重置按鈕 |
type |
image |
圖像形式的提交按鈕 |
type |
file |
文件域 |
|
|
name |
由用戶自定義 |
控件的名稱 |
value |
由用戶自定義 |
input控件中的默認文本值 |
size |
正整數 |
input控件在頁面中的顯示寬度 |
checked |
checked |
定義選擇控件默認被選中的項 |
maxlength |
正整數 |
控件容許輸入的最多字符數 |
label標籤(提高用戶體驗)
<label>
用戶名:<input type="text" name="username" value="">
</label>
textarea控件(文本域)
<textarea>
文本內容
</textarea>
select下拉列表
<select>
<option>選項1</option>
<option>選項2</option>
<option>選項3</option>
...
</select>
<form action="url地址" method="提交方式get/post" name="表單名稱">
</form>