html5表单设置基础学习
1、表单:登录注册页面
form:表单框
action=“提交的地方”
method="get/post"get会显示账号密码,Post更安全
2、用户名
type=“输入框类型”
value=“初始值”
text:文本类型
placeholder=“提示信息”
name=“输入框名字”,文本框:username,密码框:pass
3、单选框 :name值一定要相等
男
女
4、复选框
睡觉
吃饭
打豆豆
5、超链接标签
href=“地址链接”
target=“定义新页面打开方式_self(当前页面),_blank(新窗口)”
具体的html文件的代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>表单</title>
</head>
<body>
<!-- 表单:登录注册页面 -->
<!-- form表单框 -->
<!-- action="提交的地方" -->
<!-- method="get/post"get会显示账号密码,Post更安全 -->
<form action="1.php" method="post">
<!-- 用户名
type="输入框类型"-->
<!-- value="初始值" -->
<!-- text:文本类型 -->
<!-- placeholder="提示信息" -->
<!-- name="输入框名字" -->
<!-- 文本框 -->
<input type="text" value="请输入手机号" name="username"/>
<!-- 密码框-->
<input type="password" placeholder="请输入密码" name="pass"/>
<!-- 单选框 name值一定要相等-->
<input type="radio" name="sex"/>男
<input type="radio" name="sex"/>女
<br /> <!-- 强制换行标签 -->
<input type="radio" name="rel"/>成年
<input type="radio" name="rel"/>未成年
<br />
<!-- 复选框 -->
<input type="checkbox" name='hobby'/>睡觉
<input type="checkbox" name='hobby'/>吃饭
<input type="checkbox" name='hobby'/>打豆豆
<!-- 图像域 -->
<input type="image" src="img/2.jpg"/>
<!-- 文本域 -->
<input type="file"/>
<!-- 按钮 -->
<input type="submit" value="提交"/>
<!-- 重置按钮 -->
<input type="reset" value="重置"/>
<!-- 按钮:不提交信息 -->
<button>按钮</button>
</form>
<!-- 网页控制台快捷键F12或Fn+F12 -->
<!-- 超链接标签 -->
<!-- href="地址链接" -->
<!-- target="定义新页面打开方式_self(当前页面),_blank(新窗口)" -->
<a href="" target="blank">百度</a>
</body>
</html>