1、文本输入
文本框
注:上面设置value值,表示设置默认值
密码框
文本域
隐藏域
2、按钮
提交按钮 点击后转到form内的提交服务器的地址
注:上面中设置value值表示运行时上面显示的文字。
重置按钮
普通按钮
图片按钮
附:
disabled,使按钮失效;enable,使可用。
3、选择输入
单选按钮组 name的值用来分组;value值看不见,是提交给程序用的;checked,设置默认选项。
注:单选按钮组选中后不可取消。
复选框组
注:checked="checked"表示一上来就选中,且复选框可选中可取消。
文件上传
标签为 input 元素定义标注(标记)。
label 元素不会向用户呈现任何特殊效果。不过,它为鼠标用户改进了可用性。如果您在 label 元素内点击文本,就会触发此控件。就是说,当用户选择该标签时,浏览器就会自动将焦点转到和标签相关的表单控件上。
标签的 for 属性应当与相关元素的 id 属性相同。
下拉列表框
--size=1时,为菜单;>1时,为列表。multiple为多选。
内容1
内容2 --selected,设为默认
内容3
综上HTML程序显示:
1 DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://HdhCmsTestw3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > 2 html xmlns ="http://HdhCmsTestw3.org/1999/xhtml" > 3 head > 4 meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" /> 5 title > 无标题文档 title > 6 head > 7 8 body background ="22.jpg" > 9 form > 10 账号: input type ="text" value ="12345" disabled ="disabled" /> br /> br /> 11 密码: input type ="password" /> br /> br /> 12 说说: textarea cols ="140" rows ="8" > textarea > br /> br /> 13 请问:中华人民共和国成立于那一年? input type ="text" /> 14 input type ="submit" value ="提交" /> 15 input type ="hidden" value ="1949" /> 16 input type ="reset" /> br /> 17 input type ="button" value ="登录" /> br /> 18 input type ="image" src ="55.jpg" /> br /> 19 input type ="radio" name ="sex" /> 男 br /> 20 input type ="radio" name ="sex" /> 女 br /> 21 input type ="checkbox" checked ="checked" /> 可乐 br /> 22 input type ="checkbox" /> 鸡腿 br /> 23 input type ="file" /> br /> br /> 24 select size ="1" > 25 option value ="11" > 可口可乐 option > 26 option value ="22" > 雪碧 option > 27 option value ="33" selected ="selected" > 芬达 option > 28 select > 29 form > 30 body > 31 html >
查看更多关于HTML基础(二)表单,图片热点,网页划区和拼接的详细内容...