1、表单的初始化标签

  

<form action="#" method="get"><!--表单的开始-->

</form>

  属性:

    action:提交表单的跳转地址,可以是后台方法,也可以是前台页面

    method:表单的提交方式:post;get

    name:表单名称

2、表单中的提示语包裹元素

 <!--点击提示语,对应的输入框自动获取焦点-->
<!--方法一-->
<label for="username">用户名</label>
<input type="text" name="name" id="username">
<!--方法二-->
<label>用户名<input type="password" name="word" id="password"></label>

3表单的分组标签

  <form action="#" method="get"><!--表单的开始-->
<fieldset>
<legend>用户注册信息</legend>
<!--点击提示语,对应的输入框自动获取焦点-->
<!--方法一-->
<label for="username">用户名</label>
<input type="text" name="name" id="username">
<!--方法二-->
<label>用户名<input type="password" name="word" id="password"></label>
</fieldset>
<fieldset>
<legend>个人详细资料</legend>
<label>年龄<input type="text" name="" id=""></label>
</fieldset> </form>

4、表单中的input属性

1>html4相关的input

 <fieldset>
<legend>h4的相关input标签type值</legend>
<!--文本输入框-->
<input type="text" name="" id="">
<!--密码输入框-->
<input type="password" name="" id="">
<!--文件选择框-->
<input type="file" name="" id="">
<!--多选框-->
<input type="checkbox" name="hh" id="">
<input type="checkbox" name="hh" id="">
<!--单选框-->
<input type="radio" name="aa" id="">
<input type="radio" name="aa" id="">
<!--按钮-->
<input type="button" value="按钮">
<input type="submit" value="提交">
<input type="reset" value="重置">
<!--隐藏框(只是单纯的用于传值到后台)-->
<input type="hidden" name="" value="传入后台的值">
<!--图片框(也是具有提交的效果)-->
<input type="image" src="../imgs/happy.gif" alt="">
</fieldset>

2>html5新增的input标签

        <fieldset>
<legend>html5的新增input标签,一般用于移动端</legend>
<!--邮箱-->
<input type="email" name="" id="">
<!--电话-->
<input type="tel" name="" id="">
<!--ip地址-->
<input type="url" name="" id="">
<!--搜索-->
<input type="search" name="" id="">
<!--区域范围-->
<input type="range" name="" id="">
<!--颜色-->
<input type="color" name="" id="">
<!--数字-->
<input type="number" name="" id="">
<!--有关时间的-->
<!--时分-->
<input type="time" name="" id="">
<!--年月日-->
<input type="date" name="" id="">
<!--年月-->
<input type="month" name="" id="">
<!--年星期-->
<input type="week" name="" id="">
<!--当地时间-->
<input type="datetime-local" name="" id="">
</fieldset>

5、h5新增的其他属性

  1>placeholder:在文本框中显示,填写信息时消失(属性名=属性值时可以只写属性名)

    

       <input type="text" name="" id="" placeholder="哈哈哈哈哈">
<!--这个属性对于file的input标签不起作用-->
<input type="file" name="" id="" placeholder="hhhhh">

  2>autofofus或者autofocus="autofucos":自动获取焦点

            <!--自动获取焦点-->
<input type="text" name="" id="" autofocus>

  3>multiple:多文件上传

             <!--多文件上传-->
<input type="file" name="" id="" multiple>

  4>autocomplete="on":自动填充

         <!--自动填充-->
<input type="datepickers" name="" id="" autocomplete="on">
<input type="text" name="" id="" autocomplete="off">

  5>required:必填项

  

        <!--必填项-->
<input type="email" name="" id="" required>

  6>accesskey:快捷键让元素获得焦点alt+s

 <!--让快捷键alt+s快速让元素获得焦点-->
<input type="text" name="" id="" accesskey="s">

html常用标签6-表单标签的更多相关文章

  1. 5.22 HTML 列表标签和表单标签

    1,ul无序列表 标签 ul:unordered list ,就是无序列表的意思. li:  listitem  列表项的意思.无序列表的每一项都是<li>. <!DOCTYPE h ...

  2. Day46(列表标签,表格标签,表单标签,css的引入方式,css选择器)

    一.列表标签 列表标签分为三种. 1.无序列表<ul>,无序列表中的每一项是<li> 英文单词解释如下: ul:unordered list,“无序列表”的意思. li:lis ...

  3. HTML的表格标签,列表标签,表单标签,HTML5有哪些新特性

    欢迎大家去博客冰山一树Sankey,浏览效果更好.直接右上角搜索该标题即可 博客园主页:博客园主页-冰山一树Sankey CSDN主页:CSDN主页-冰山一树Sankey 前端学习:学习地址:黑马程序 ...

  4. [原创]java WEB学习笔记62:Struts2学习之路--表单标签:form,表单标签的属性,textfield, password, hidden,submit ,textarea ,checkbox ,list, listKey 和 listValue 属性,select ,optiongroup ,checkboxlist

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  5. 028、HTML 标签3表单标签插入组件

    内容:表单标签插入组件(经常使用)############################################################## form表单标签和input组件 < ...

  6. Kure讲HTML_列表标签及表单标签

    首先我上个图来告诉大家什么是列表 左侧的这一部分就可以称为是列表或者叫树,其实我们可以通过div+css实现列表,可是考虑语义化的问题,我们还是看看html提供好的列表标签,html提供了两种列表,一 ...

  7. 制作Html标签以及表单、表格内容

    制作Html一般用DW(......),Html全称为(Hyper Text Markup Language   超文本标记语言) 文本就是平常电脑上的文本文档,只能存储文字,而超文本文档可以存储音乐 ...

  8. struts2:表单标签

    目录 表单标签1. form标签2. submit标签3. checkbox标签4. checkboxlist标签5. combobox标签6. doubleselect标签7. head标签8. f ...

  9. 第二天(就业班) html的引入、html常用标签、实体标签、超链接标签、图片标签、表格、框架标签、表单[申明:来源于网络]

    第二天(就业班) html的引入.html常用标签.实体标签.超链接标签.图片标签.表格.框架标签.表单[申明:来源于网络] 第二天(就业班) html的引入.html常用标签.实体标签.超链接标签. ...

  10. HTML学习二_HTML常用的行级标签,常用实体字符及表单标签

    HTML常用的行级标签(行内元素)不独占一行### 有语义的行内元素 #### HTML链接 a标签 ```angular2html<a href="链接地址">链接文 ...

随机推荐

  1. Perl 基础语法

    Perl 基础语法 Perl借用了C.sed.awk.shell脚本以及很多其他编程语言的特性,语法与这些语言有些类似,也有自己的特点. Perl 程序有声明与语句组成,程序自上而下执行,包含了循环, ...

  2. thinkphp 调试模式

    ThinkPHP有专门为开发过程而设置的调试模式,开启调试模式后,会牺牲一定的执行效率,但带来的方便和除错功能非常值得. 直线电机哪家好直线电机生产厂家 我们强烈建议ThinkPHP开发人员在开发阶段 ...

  3. 三模数NTT模板

    求两个多项式的卷积对任意数p取模 两个好记的FNT模数: 5*2^25+1 7*2^26+1 原根都为3 //Achen #include<algorithm> #include<i ...

  4. (转)Android在子线程中更新Activity中UI的方法

    转:http://blog.sina.com.cn/s/blog_3fe961ae0100mvc5.html 在Android平台下,进行多线程编程时,经常需要在主线程之外的一个单独的线程中进行某些处 ...

  5. error C2872: 'ULONG_PTR' : ambiguous symbol

    转自VC错误:http://www.vcerror.com/?p=74 问题描述: 错误:error C2872: 'ULONG_PTR' : ambiguous symbol 解决方法: 详细的解决 ...

  6. (转) Mac下面的SecureCRT(附破解方案) 更新到最新的7.3.7

    Mac下面的SecureCRT(附破解方案) 更新到最新的7.3.7 转自 http://blog.csdn.net/skykingf/article/details/17450561 http:// ...

  7. iconfont 在vue项目中的应用(icon-component组件)

    前言:上一篇记录了iconfont的三种基本使用方法. 在Vue中应该如何使用呐?Vue中的组件化思想很明确,要提高组件的复用率,增强项目的可维护性,扩展性.以下是采用icontfont的使用方式之s ...

  8. Python - 作为浅拷贝的list对象乘法

    运行下面这段代码 # !/usr/bin/env python3 # -*- coding=utf-8 -*- temp_a = [[0]*2]*3 temp_b = [[0]*2 for i in ...

  9. websocket 实现消息推送(转)

    介绍 现很多网站为了实现即时通讯,所用的技术都是轮询(polling).轮询是在特定的的时间间隔(如每1秒),由浏览器对服务器发出HTTP request,然后由服务器返回最新的数据给客服端的浏览器. ...

  10. db.Database.SqlQuery完成分页封装

    调用代码: string sql = @"SELECT a.Id ,c.Title,a.Content,a.Status,b.ReportSum FROM dbo.Comment AS a ...