form 表单 常用于收集不同类用户的输入,允许用户收集:文本域(text)、下拉列表(select)、单选框(radio)、复选框(checkbox) 以及动按纽(action)
表单标签

大多数表单标签都是input标签,输入类型是(type)定义的。
例:<form>
<input type="text" name="first_text">
立即学习“前端免费学习笔记(深入)”;
<input type='text' name="address" value="广东"> 当需要默认值时用 value属性
<input type="radio" name="姓别" value="boy">
<input type="radio" name="姓别" value="boy" checked="selected" / >(默认选中) 单选
<input type="checkbox" name="老虎">
<input type="checkbox" name="地名",value="江西" checked="selected"> (默认选中) 多选
下拉列表使用到的元素为: select 属性为:option
例:
<select>
<option value="dongfong">东风</option>
<option value="qq" selected="select" >寄瑞</option> selected为默认选择属性 <option value="jili">吉利</option>
</select>
</form>

本例演示如何在数据周围绘制一个带标题的框。
<form>
<fieldset>
<legend>健康信息</legend>
身高:<input type="text" />
三围:<input type="text" />
</fieldset>
</form>
Button 按钮的三个属性
submit 该按钮是提交按钮(除了 Internet Explorer,该值是其他浏览器的默认值)。
button 该按钮是可点击的按钮(Internet Explorer 的默认值)。
reset 该按钮是重置按钮(清除表单数据)。
<form action="form_action.asp" method="get"> First name: <input type="text" name="fname" /> Last name: <input type="text" name="lname" /> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> </form>
以上就是HTML CSS之FORM的详细介绍的详细内容,更多请关注php中文网其它相关文章!
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号