html下拉列表(零基礎(chǔ)學(xué)習(xí)HTML背景表單單選按鈕復(fù)選框上傳文件下拉列表)
HTML 背景
設(shè)置背景顏色<body bgcolor="#000000">
設(shè)置背景圖片<body background="bg.jpg">
設(shè)置頁面文字顏色<body text="#cccccc">
顏色屬性值有三種值的格式
1,英文單詞,比如 red , yellow ,green …
<body bgcolor="yellow">
2, 十六進(jìn)制表示方式,#開頭,6個(gè)十六進(jìn)制的字符或數(shù)字 組合
比如:#FFFFFF,#000000,#CCCAAA,#22BCAD
十六進(jìn)制: 0-9 和 a-f
3, RGB模式,紅 0-255,綠 0-255,藍(lán) 0-255
比如: RGB(120,33,234)
HTML 表單
表單是一個(gè)包含表單元素的區(qū)域。
表單能夠包含 input 元素,textarea、select、fieldset、legend 和 label 元素。
表單使用標(biāo)簽(<form>)定義。
表單用于向服務(wù)器傳輸數(shù)據(jù)。
表單的結(jié)構(gòu)
<form name="form1" action="URL" method="get">
用戶名:<input type="text" name="uname" />
密 碼:<input type="password" name="passwd" />
</form>
屬性說明
name表單的名稱
action表單提交地址
method表單數(shù)據(jù)提交的方式 (get ,post)
enctypeMIME類型
target打開方式
input標(biāo)簽
屬性說明
typeinput元素類型
nameinput 元素的名稱
valueinput 元素的值
sizeinput 元素的寬度
readonly是否只讀
maxlength輸入字符的最大長度
disabled是否禁用
1.文本框
<input type="text" name="username" value="" />
2.密碼框
<input type="password" name="passwd"/>
3.單選按鈕
<input type="radio" name="sex"value="1"checked="checked" />男
<input type="radio" name="sex"value="0"/>女
4.復(fù)選框
<input type="radio" name="sex"value="1"checked="checked" />男
<input type="radio" name="sex"value="0"/>女
<input type="checkbox"name="love"value="music" checked="checked"/> 聽音樂
<input type="checkbox"name="love" value="movie"/> 看電影
<input type="checkbox"name="love" value="game"/> 玩游戲
5.按鈕
<input type="button" name="btn" value="確定"/>
<input type="submit" name="comit" value="提交"/>
<input type="reset" name="reset" value="重寫"/>
<input type="image" name="img_btn" src="btn.gif"/>
6. 隱藏域
隱藏域用于在程序發(fā)送沒有必要讓用戶看到特定值的時(shí)候使用。
<input type="hidden" name="uid" value="10"/>
7. 上傳文件
<input type="file" name="photo"/>
注:利用這項(xiàng)功能時(shí),在 form 標(biāo)簽中要指定method屬性。要把method 指定為post, enctype屬性指定為 multipart/form-data。
<textarea> 多行文本框
<textarea name="content" rows="5" cols="50"> </textarea>
屬性說明
name元素的名稱
rows指定文本框的高度
cols指定文本框的寬度
select下拉列表框
<select name="city">
<option value="0">請(qǐng)選擇</option
<option value="bj">北京</option>
<option value="gz">廣州</option>
</select>
屬性說明
name下拉列表框的名稱
size下拉列表框的顯示行數(shù)
multiple是否多選
disabled是否禁用
selected設(shè)置默認(rèn)選中的選項(xiàng)
value選項(xiàng)的值
optgroup標(biāo)簽
optgroup 元素用于組合選項(xiàng) 。
屬性說明
label指定組合選項(xiàng)名稱
fieldset標(biāo)簽
fieldset 標(biāo)簽作用是把表單中元素組合起來
<fieldset>
<legend></legend> length為字符長度
<form></form>
</fieldset>
label標(biāo)簽
lable 標(biāo)簽的作用是將輸入項(xiàng)或選項(xiàng)及其標(biāo)簽文字關(guān)聯(lián)起來。
<input type="radio" name="sex" value="1" />
<label for="male">男</label>
<input type="radio" name="sex" value="0" />
<label for="female">女</label>
轉(zhuǎn)載請(qǐng)注明來自夕逆IT,本文標(biāo)題:《html下拉列表(零基礎(chǔ)學(xué)習(xí)HTML背景表單單選按鈕復(fù)選框上傳文件下拉列表)》

還沒有評(píng)論,來說兩句吧...