HTML--4标签及简单使用(form收集用户信息--input type select-option textarea)---外加注释标签<!-- xxx -->

表单标签:form--------是一个区域,采集用户信息 action:收集的信息给什么页面处理

表单元素:用户名文本框 text/密码文本框password(里面的内容用*显示)、密码框,按钮,复选,下拉列表、文本域

 表单元素没有换行操作 name当前表单的名字是什么

表单元素:文本框

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>首页</title>
	<style type="text/css">
		span{
			color: red;
			font-weight: bold;
		}
	</style>
</head>
<body>
	<div align="center" >
		<form action="#">
			账号:<input type="text" name="1" id="1" ><br>
			密码:<input type="password" name="2" id="2">
		</form>
	</div>
</body>
</html>

 表单元素:按钮 (提交按钮submit、重置按钮reset)

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>首页</title>
	<style type="text/css">
		span{
			color: red;
			font-weight: bold;
		}
	</style>
</head>
<body>
	<div align="center" >
		<form action="#">
			姓名:<input type="text" name="1" id="1" >&nbsp;&nbsp;&nbsp;<input type="submit" name="3" value="提交">&nbsp;&nbsp;&nbsp;<input type="reset" name="3" value="重置">
		</form>
	</div>
</body>
</html>

  表单元素:单选框(只能选择一项)radio、复选框 checkbox

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>首页</title>
	<style type="text/css">
		span{
			color: red;
			font-weight: bold;
		}
	</style>
</head>
<body>
	
		<form action="#">
			性别:男<input type="radio" value="zhi" name="1" checked="checked"><!--checked="checked代表默认选中name必须相同 -->&nbsp;&nbsp;&nbsp;女<input type="radio" value="给后端" name="1" >
			<br>
			爱好:体育<input type="checkbox" value="ee" name="3" checked="checked">
			音乐<input type="checkbox" value="e" name="4">
			读书<input type="checkbox" value="e3e" name="5">
		</form>

</body>
</html>

  

   表单元素:下拉列表 使用select-option(节省空间)---也有一个默认选中的栏目

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>首页</title>
	<style type="text/css">
		span{
			color: red;
			font-weight: bold;
		}
	</style>
</head>
<body>
	
		<form action="#">
			爱好:
			<select>
				<option >看手机</option>
				<option >看书</option>
				<option selected="selected">堪舆</option>
				<option >看人</option>
			</select>
		</form>

</body>
</html>

   表单元素:文本域 textarea--规定当前表单有多少行的输入

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>首页</title>
	<style type="text/css">
		span{
			color: red;
			font-weight: bold;
		}
	</style>
</head>
<body>
	
		<form action="#">
			个人简介:<br>
			<textarea  cols="20" rows="10">
				在这里输入内容
			</textarea>
			<br>
			<input type="submit" value="确定">
			<input type="reset" value="重置">
		</form>

</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值