html制作简单的表单<form>
⽂章⽬录
⼀、使⽤到的标签⽤法介绍
1.演⽰标签代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="/demo/demo_form.asp">
First name:<br>
<input type="text"name="firstname"value="Lalisa">
<br>
Last name:<br>
<input type="text"name="lastname"value="Manoban">
<br><br>
<input type="submit"value="提交">
</form>
</body>
</html>
2.标签使⽤具体介绍
1. < form action=“获取/提交的地址” method=“post/get”>
post表⽰提交,get表⽰获取
get与post的区别:
get请求发送的数据都写在地址栏上,⽤户可见
post请求发送的数据⽤户不可见
get不能提交⼤量数据,但是post可以
2.< input type=“类型” name=“⾃定义名称” value=“显⽰的⽂字” style=“设置长宽颜⾊等样式”>
input必须放在form标签内才可以⽣效或提交
type常见的属性值:
text ⽂本输⼊框
button 普通按钮
password 密码输⼊框
submit 提交
radio 单选框
reset 重置
checkbox 复选框
file ⽂本选择框
style=“width:80px;height:30px;background:white;”
⼆、表单制作代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="提交的地址"method="post">
<table width="600px"border="1px"cellspacing="0"cellpadding="">
<tbody>html代码转链接
<tr height="40px">
<td rowspan="4"align="center" >总体信息</td>
<td colspan="2"></td>
</tr>
<tr height="40px">
<td align="right">⽤户名:</td>
<td>
<input type="text"name="loginname"id=""value=""/>
</td>
</tr>
<tr height="40px">
<td align="right">密码:</td>
<td>
<input type="password"name="password"id=""value=""/>
</td>
</tr>
<tr height="40px">
<td colspan="2"align="center">
<input type="submit"name=""id=""value="提交" /> <input type="reset"name=""id=""value="重置"  /> </td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
三、结果显⽰

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。