form:表單標(biāo)簽 創(chuàng)建一個(gè)表單區(qū)域 雙標(biāo)簽 塊級(jí)標(biāo)簽
<form action="" method=""></form>
action:提交后臺(tái)的地址
method:提交信息/數(shù)據(jù)的方式 get(不能用來(lái)顯示安全性高的數(shù)據(jù),會(huì)顯示在地址欄中) post
<input type="text" name="username" placeholder="請(qǐng)輸入您的用戶名"/>
<input type="password" name="password" placeholder="請(qǐng)輸入您的密碼"/>
<input type="submit" value="登陸" />
<input type="reset" value="清空" />
input: 表單元數(shù)據(jù) 單標(biāo)簽 行塊級(jí)標(biāo)簽
- type="text" 定義文本輸入框
- type="password" 定義密碼輸入框
- type="submit" 定義數(shù)據(jù)信息提交按鈕
- type="reset" 定義數(shù)據(jù)信息重置按鈕
- name="" 定義數(shù)據(jù)名稱(字段名稱)
value="" 定義默認(rèn)值 | 信息
placeholder="" 定義提示信息
<label for="user">用戶名:</label>
<input id="user" type="text" name="username" placeholder="請(qǐng)輸入您的用戶名">
label:關(guān)聯(lián)標(biāo)簽 雙標(biāo)簽
- for屬性:通過(guò)id名稱進(jìn)行關(guān)聯(lián)
input:focus{
background:red;
}
input:focus 鼠標(biāo)點(diǎn)擊輸入框觸發(fā)的狀態(tài)(聚焦)靠娱。