Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
單標(biāo)簽
常見(jiàn)的語(yǔ)句:
form:表單標(biāo)簽格式
作用:用來(lái)收集用戶輸入信息如:登入、注冊(cè)、搜索商品等
action:開始網(wǎng)址
method:get和post等等
text (明文):用戶名格式
password :(密文)密碼
radio :?jiǎn)芜x框 性別格式 性別是單選,單選類型是radio,注意name要加上sex
checkbox:復(fù)選框
textarea:文本框
file:上傳文件
select:下拉選擇框
button:按鈕
reset:重置
submit:提交
詳解:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>表單標(biāo)簽</title>
</head>
<body>
<form action="https://hao.360.com/" method="post">
<p>賬號(hào):<input type="text" /></p>
<p>密碼:<input type="password" /></p>
<p>
<input type="radio" name="sex" id="" />男
<input type="radio" name="sex" id="" />女
</p>
<p>
<input type="checkbox" name="" id="" value="" />linux
<input type="checkbox" name="" id="" value="" />mysql
<input type="checkbox" name="" id="" value="" />html
<input type="checkbox" name="" id="" value="" />python
</p>
<p>學(xué)歷
<select name="">
<option value="">請(qǐng)選擇學(xué)歷</option>
<option value="">小學(xué)</option>
<option value="">初中</option>
<option value="">高中</option>
<option value="">大學(xué)</option>
</select>
</p>
<p>自我介紹:<br />
<textarea name="" rows="10" cols="30"></textarea>
</p>
<input type="reset" value="重置"/>
<input type="submit" value="提交"/>
<input type="button" value="按鈕"/>
</form>
</body>
</html>
TML 表單用于收集不同類型的用戶輸入,它是一個(gè)包含表單元素的區(qū)域。
表單元素是允許用戶在表單中輸入內(nèi)容,比如:文本域(textarea)、下拉列表、單選框(radio-buttons)、復(fù)選框(checkboxes)等等。今天我們主要來(lái)說(shuō)說(shuō)文本域和密碼域這兩個(gè)部分,希望對(duì)大家學(xué)習(xí)有所幫助喲!
本文福利后臺(tái)回復(fù)【學(xué)習(xí)】即可獲得Python、HTML等編程學(xué)習(xí)資料
HTML 表單
表單使用表單標(biāo)簽 <form> 來(lái)設(shè)置:
<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>
HTML 表單 - 輸入元素
多數(shù)情況下被用到的表單標(biāo)簽是輸入標(biāo)簽(<input>)。輸入類型是由類型屬性(type)定義的。
如何在 HTML 頁(yè)面創(chuàng)建文本域?
用戶可以在文本域中寫入文本,參考代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鳥教程(runoob.com)</title>
</head>
<body>
<form action="">
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>
<p><b>注意:</b> 表單本身是不可見(jiàn)的。并且注意一個(gè)文本字段的默認(rèn)寬度是20個(gè)字符。</p>
</body>
</html>
運(yùn)行結(jié)果為
如何創(chuàng)建 HTML 的密碼域?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鳥教程(runoob.com)</title>
</head>
<body>
<form action="">
Username: <input type="text" name="user"><br>
Password: <input type="password" name="password">
</form>
<p><b>注意:</b> 密碼字段中的字符是隱藏的(顯示為星號(hào)或圓圈)。</p>
</body>
</html>
運(yùn)行結(jié)果如下
戳了解更多免費(fèi)領(lǐng)取HTML試聽(tīng)課~
1、表單:就是從網(wǎng)頁(yè)上看見(jiàn)的各種各樣的框,比如 登陸框、同意協(xié)議的選項(xiàng)框、下拉框、只能選男女的選框等。
代碼需要復(fù)制到編譯器里面看,效果會(huì)好些
代碼實(shí)例:所有的框、按鈕,都在下面的代碼中,并且有注釋,照著寫就好
注意事項(xiàng):?jiǎn)螛?biāo)簽的內(nèi)容是單標(biāo)簽的屬性(也就是在標(biāo)簽中加入 value 屬性);雙標(biāo)簽的內(nèi)容在兩個(gè)標(biāo)簽之間。
注意事項(xiàng):
1、表單元素中,用戶可以輸入值的時(shí)候,可以不加value屬性 -- (比如:文本框、文本域)。
2、當(dāng)表單元素中沒(méi)有值的時(shí)候,需要加value屬性 -- (比如:?jiǎn)芜x框、復(fù)選框)。
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。