◆知识要点
1. 在 HTML 中,使用 <textarea> 标签来表示多行文本框,又叫做文本域。与其它 <input> 标签不同,<textarea> 标签是单闭合标签,它包含起始标签和结束标签,文本内容需要写在两个标签中间。具体语法格式如下:
<textarea name=" description" cols="20" rows="20 " placeholder="请留下您宝贵的意见与建议!"></textarea>
文本域<textarea>其它属性
图1
2. HTML 下拉列表是由 <select><option> 配合使用的。具体语法格式如下:
<select name=" selectList " size="2" multiple="multiple">
<option selected="selected" value="选项一">选项一</option>
<option value="选项二">选项二</option>
<option value="选项三">选项三</option>
……
</select>
下拉列表<select>属性
图2
3.<label> 标签来定义表单控制间的关系,当用户选择该标签时,浏览器会自动将焦点转到和标签相关的表单控件上。具体语法格式如下:
<label for="id_name">选项内容</label><input type="radio" name="" value="选项内容" id=" id_name "/>
图3
◆HTML5代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="#" method="post">
<table align="center" border="0" cellpadding="5px" cellspacing="1px" bgcolor="beige">
<tr height="40px">
<td colspan="2" align="center"><h2>会员注册</h2></td>
</tr>
<tr height="40px">
<td width="150px" align="right">性质</td><td width="300px"><input type="radio" name="xz" value="公司"/>公司<input type="radio" name="xz" value="个人"/>个人</td>
</tr>
<tr height="40px">
<td align="right">呢称</td><td><input type="text" name="user" value="" placeholder="小明"/></td>
</tr>
<tr height="40px">
<td align="right">密码</td><td><input type="password" name="ps" value="" placeholder="密码"/></td>
</tr>
<tr height="40px">
<td align="right">电子邮箱</td><td><input type="email" name="email" value="" /></td></tr>
<tr height="40px">
<td align="right">所在地</td>
<td>
<select multiple="multiple" size="1" name="szd" id="szd" >
<option value="清远">清远</option>
<option value="中山">中山</option>
<option value="东莞">东莞</option>
</select>
</td>
</tr>
<tr height="40px"><td align="right">身份证号码</td><td><input type="text" name="sfzh" value="" /></td></tr>
<tr height="40px"><td align="right">手机号码</td><td><input type="text" name="sjhm" value="" /></td></tr>
<tr height="40px"><td align="right">意见反馈</td><td><textarea cols="22" rows="10" name="yjfk" placeholder="如果您有什么意见和反馈请告诉我"></textarea></td></tr>
<tr height="40px"><td colspan="2" align="center"><input type="reset" value="提交" /><input type="reset" value="重置" /></td></tr>
</table>
</form>
</body>
</html>
,