標籤:多列 get ado 關係 ul li 下拉式清單 set 資料顯示 長度
表單元素:用於用戶端和服務端進行資訊互動的通道
<form></form>:所有的表單元素都應該放在裡面
文本輸入框:
<input type="text"/>
屬性:
name="小狗",每個表單元素都有name屬性
value="值",每個表單元素都有value屬性,value值是隨著使用者輸入而改變
size="5",設定文本輸入框的長度
maxlength="10",最多可以輸入的字元數
placeholder="提示資訊",提示
readonly="readonly",唯讀
密碼輸入框
<input type="password"/>
name/value等屬性,屬性完全跟文本輸入框一致
單選框
<input type="radio"/>
name/value屬性
checked="checked",表示被選中
複選框
<input type="checkbox"/>
name/value屬性
checked="checked",表示被選中
下拉式清單
<select>---選擇
<option></option>---項
</select>
select的屬性:name/value
multiple="multiple",變成列表框(multiple:多列)
size="2",表示顯示2行
option的屬性:
selected="selected",表示哪一項被選中
disabled="disabled",表示禁止被選中
value="值"
------------------------
按鈕
普通按鈕:
<input type="button"/>
name/value
<button type="button">按鈕</button>
<button>按鈕</button>
屬性:type/name/value
type="button(按鈕)/reset(重設)/submit(提交)",預設為button
重設按鈕:
<input type="reset" value="重設"/>
<button type="reset">重設</button>
提交按鈕:
<input type="submit" value="提交"/>
<button type="submit">提交</button>
提交按鈕有頁面重新整理的效果,同時可以將文本輸入框和密碼輸入框的相關資訊提交到地址欄上
檔案按鈕:
<input type="file"/>---只能選擇檔案,不能選擇檔案夾
name/value屬性
圖片按鈕:
<input type="image" src="圖片的路徑"/>
屬性:name/value/width/height
------------------------
隱藏欄位:
<input type="hidden"/>
文本域:
<textarea></textarea>
有name屬性,沒有value屬性
cols="50",設定文本域的寬度
rows="5",設定文本域的高度
------------------------
<label></label>
屬性:
for="id名"
<label for="admin">帳號:<input type="text" id="admin"/></label>
<label for="pwd">密碼:</label><input type="password" id="pwd"/>
label標籤可以為表單元素定義,使文本和表單元素之間的關係更緊湊
------------------------
<form></form>
屬性:
action="路徑",跳轉到某個頁面,將表單元素裡面資料提交到某個頁面
method="get/post"
get:會將資料顯示在地址欄上
post:不會將資料顯示在地址欄上
----------------------------
內聯架構
<iframe></iframe>
在當前頁面中劃分出一塊地區用來顯示另外一個頁面
屬性:
src="相對路徑"
width="1000px/80%",設定顯示地區的寬度
height="1000px/80%",設定顯示地區的高度
frameborder="1/0",1---有邊框,0---沒有邊框
scrolling="yes/no/auto(自動)"
yes:表示顯示捲軸
no:表示不顯示捲軸
auto:表示自動顯示捲軸
----------------------------
塊級容器標籤:<div></div>
空語義標籤:沒有html屬性的標籤
行內容器標籤:<span></span>
空語義標籤
----------------------------
自動換行的標籤:
div hn p table form ul li ol dl...
不會自動換行的標籤:
span i b font u s img input select button a...
表單元素:用於用戶端和服務端進行資訊互動的通道
<form></form>:所有的表單元素都應該放在裡面
文本輸入框:
<input type="text"/>
屬性:
name="小狗",每個表單元素都有name屬性
value="值",每個表單元素都有value屬性,value值是隨著使用者輸入而改變
size="5",設定文本輸入框的長度
maxlength="10",最多可以輸入的字元數
placeholder="提示資訊",提示
readonly="readonly",唯讀
密碼輸入框
<input type="password"/>
name/value等屬性,屬性完全跟文本輸入框一致
單選框
<input type="radio"/>
name/value屬性
checked="checked",表示被選中
複選框
<input type="checkbox"/>
name/value屬性
checked="checked",表示被選中
下拉式清單
<select>---選擇
<option></option>---項
</select>
select的屬性:name/value
multiple="multiple",變成列表框(multiple:多列)
size="2",表示顯示2行
option的屬性:
selected="selected",表示哪一項被選中
disabled="disabled",表示禁止被選中
value="值"
------------------------
按鈕
普通按鈕:
<input type="button"/>
name/value
<button type="button">按鈕</button>
<button>按鈕</button>
屬性:type/name/value
type="button(按鈕)/reset(重設)/submit(提交)",預設為button
重設按鈕:
<input type="reset" value="重設"/>
<button type="reset">重設</button>
提交按鈕:
<input type="submit" value="提交"/>
<button type="submit">提交</button>
提交按鈕有頁面重新整理的效果,同時可以將文本輸入框和密碼輸入框的相關資訊提交到地址欄上
檔案按鈕:
<input type="file"/>---只能選擇檔案,不能選擇檔案夾
name/value屬性
圖片按鈕:
<input type="image" src="圖片的路徑"/>
屬性:name/value/width/height
------------------------
隱藏欄位:
<input type="hidden"/>
文本域:
<textarea></textarea>
有name屬性,沒有value屬性
cols="50",設定文本域的寬度
rows="5",設定文本域的高度
------------------------
<label></label>
屬性:
for="id名"
<label for="admin">帳號:<input type="text" id="admin"/></label>
<label for="pwd">密碼:</label><input type="password" id="pwd"/>
label標籤可以為表單元素定義,使文本和表單元素之間的關係更緊湊
------------------------
<form></form>
屬性:
action="路徑",跳轉到某個頁面,將表單元素裡面資料提交到某個頁面
method="get/post"
get:會將資料顯示在地址欄上
post:不會將資料顯示在地址欄上
----------------------------
內聯架構
<iframe></iframe>
在當前頁面中劃分出一塊地區用來顯示另外一個頁面
屬性:
src="相對路徑"
width="1000px/80%",設定顯示地區的寬度
height="1000px/80%",設定顯示地區的高度
frameborder="1/0",1---有邊框,0---沒有邊框
scrolling="yes/no/auto(自動)"
yes:表示顯示捲軸
no:表示不顯示捲軸
auto:表示自動顯示捲軸
----------------------------
塊級容器標籤:<div></div>
空語義標籤:沒有html屬性的標籤
行內容器標籤:<span></span>
空語義標籤
----------------------------
自動換行的標籤:
div hn p table form ul li ol dl...
不會自動換行的標籤:
span i b font u s img input select button a...
web前端2017.6.10