铏界劧緇忓父鎺ヨЕHTML錛屼笉榪囨湁浜涙爣絳句互鍓嶅嵈浠庢病寮曡搗鎴戠殑娉ㄦ剰銆備絾鏄叾涓嚑涓猅ag鐨勭‘姣旇緝鏈夌敤錛岃屼笖鏄鍚圵3C XHTML鏍囧噯鐨勩?/p>
1. Label
Label鏄敤鏉ユ爣璁癐nput鍏冪礌鐨勬彁紺虹殑銆備緥濡傦細
<label for="id_name">Name</label><br />
<input type="text" name="name" id="id_name" size="20"/>
Label鐨?#8220;For”灞炴ц鍜孖nput鍏冪礌鐨処D鐩鎬竴鑷淬?/p>
濂藉錛氱偣鍑繪彁紺烘枃瀛楋紝灝辮嚜鍔‵ocus瀵瑰簲鐨勮緭鍏ュ厓绱犮傚浜嶳adio錛孋heckbox榪欑被鐐瑰嚮鍖哄煙鐗瑰埆灝忕殑鎺т歡鐗瑰埆鏈夌敤錛?br />
Color:<br />
<inputtype="checkbox"
name="color" id="color_r"
value="red"><labelfor="color_r"> red</label><br>
<inputtype="checkbox"
name="color" id="color_g"
value="green"><labelfor="color_g"> green</label><br>
<input type="checkbox" name="color" id="color_b" value="blue"><label for="color_x"> blue</label><br><!--濡傛灉For鍜孖D涓嶅尮閰嶏紝鐐瑰嚮鏂囧瓧鏄病鏈夌敤鐨?->
2. FieldSet & Legend
FieldSet鐢ㄦ潵鏄庣‘鎶婁竴緇処nput鎺т歡褰掓垚涓緇勶紙鐩稿綋浜嶸B/VC閲岄潰鐨凣roup鎺т歡錛夛紝鑰孡egend鍒欐槸緇勭殑鏍囬(鐩稿綋浜嶨roup鎺т歡鐨勬爣棰?銆?渚嬪錛?/p>
<fieldset style="width:20%">
<legend>Person</legend>
<label for="name">Name</label><input type="text" id="name" />
<fieldset>
<legend>Gender</legend>
<input type="radio" name="gender" id="male" /><label for="male">Male</label><br>
<input type="radio" name="gender" id="female" /><label for="female">Female</label>
</fieldset>
</fieldset>
3. Optgroup
鐢ㄤ簬Select閲岄潰鐨刼ption鐨勫垎緇勩備緥濡傦細
<select name="age">
<optgroup label="baby">
<option>0-2</option>
<option>3-5</option>
</optgroup>
<optgroup label="kid">
<option>6-10</option>
<option>10-15</option>
</optgroup>
<optgroup label="adult">
<option>16-30</option>
<option>31-40</option>
<option>41-60</option>
</optgroup>
</select>
Powered by ScribeFire.