什么是表单
在html中,表单是一个包含表单元素的区域,主要用于收集不同类型的用户输入,需要使用表单标签form来定义;而表单元素是允许用户在表单中输入内容的控件,比如输入标签(input)、文本域(textarea)等等
表单的属性
input 最主要的属性
type 包括 radio选项 text文本输入 number数字 time时间
data日期 checkbox多选项 submit提交
name name写入值 点击提交后会把input值显示在服务器上
制作的披萨订购平台
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="http://httpbin.org/post" method="post">
<span>Customer name:</span> <input type="text" name="Customer name:" id="">
<br>
<span>Telephone:</span> <input type="text" name="Telephone:" id="">
<br>
<span>E-mail address:</span> <input type="text" name="E-mail address:" id="">
<br>
<br>
<br>
<span>Pizza Size</span>
<br>
<span>samll</span> <input type="radio" name="samll" id="">
<br>
<span>Medium</span> <input type="radio" name="Medium" id="">
<br>
<span> Large</span> <input type="radio" name=" Large" id="">
<br>
<br>
<span>Pizza Toppings</span>
<br>
<span>Extra Cheese</span> <input type="checkbox" name="Extra Cheese" id="">
<br>
<span>Onion</span> <input type="checkbox" name="Onion" id="">
<br>
<span>Mushroom</span> <input type="checkbox" name="Mushroom" id="">\
<br>
<br>
<br>
<span>Preferred delivery time:</span><input type="time" name="Preferred delivery time:" id="">
<br>
<span>Delivery instructions: </span><textarea name="Delivery instructions: " id="" cols="30" rows="4"></textarea>
<br>
<br>
<input type="submit" name="" id="" value="submit order">
</form>
</body>
</html>
成果图