ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

HTML练习--制作一个表单

2021-05-17 23:02:11  阅读:170  来源: 互联网

标签:创建表格 -- 代码 表单 实现 HTML 提交 打游戏


实现效果在这里插入图片描述

通过创建表格嵌套表单实现

实现代码

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<form>
			<table  align="center" bgcolor="aqua">
				<tr>
					<th bgcolor="blue" colspan="2">
						欢迎注册
					</th>
				</tr>
				<tr>
					<th width="150" align="right">
						<label for="user">用户名:</label>
					</th>
					<th align="left">
						<input type="text" id="user" />
					</th>
				</tr>

				<tr>
					<th align="right">
						<label for="password">密码:</label>
					</th>
					<th align="left">
						<input type="password" id="password" />
					</th>
				</tr>

				<tr>
					<th align="right">
						性别:
					</th>
					<th align="left">
						<input type="radio" name="sex" id="男" />
						<label for="男">男</label>
						<input type="radio" name="sex" id="女" />
						<label for="女">女</label><br />
					</th>
				</tr>

				<tr>
					<th align="right">
						<label for="phone"> 电话:</label>
					</th>
					<th align="left">
					<input type="text" id="phone" />
					</th>
				</tr>
				<tr>
					<th align="right">
						职业:
					</th>
					<th align="left">
						<select>
							<option>请选择</option>
							<option>学生</option>
							<option>白领</option>
							<option>上班</option>
							<option>教师</option>
							<option>工人</option>
						</select><br />
					</th>
				</tr>

				<tr>
					<th align="right">
						爱好:
					</th>
					<th align="left">
						<input type="checkbox" id="敲代码" />
						<label for="敲代码">敲代码</label>
						<input type="checkbox" id="打游戏" />
						<label for="打游戏">打游戏</label>
						<input type="checkbox" id="唱歌" />
						<label for="唱歌">唱歌</label>
						<input type="checkbox" id="运动" />
						<label for="运动">运动</label><br />
					</th>
				</tr>
				<tr>
					<th align="right">
						地址:
					</th>
					<th align="left">
						<textarea rows="3"></textarea>
					</th>
				</tr>
				<tr>
					<th bgcolor="blue" colspan="2">
						填写完成后点击下面提交按钮提交表单
					</th>
				</tr>
				<tr>
					<th colspan="2">
						<input type="submit" />
						<input type="reset" />
					</th>
				</tr>
			</table>
		</form>
	</body>
</html>

最终效果

在这里插入图片描述

标签:创建表格,--,代码,表单,实现,HTML,提交,打游戏
来源: https://www.cnblogs.com/xiaofanmi/p/14778973.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有