• HTML表单基本格式与代码


    咱们先来看下今天咱们需要学习的内容,理解起来很简单,像我这种英语不好的只是需要背几个单词

    在HTML中创建表单需要用到的最基本的代码和格式

     1 <form method="post/get" >
     2 <!--文本输入-->
     3 <input type="text" />    <!--文本框-->
     4 <input type="password" />    <!--密码框-->
     5 <input type="hidden" />    <!--隐藏域-->
     6 <textarea></textarea>    <!--文本域-->
     7 <!--按钮输入-->
     8 <input type="submit" />    <!--提交按钮-->
     9 <input type="button />    <!--普通按钮-->
    10 <input type="image" />    <!--图片按钮-->
    11 <input type="reset" />    <!--重置按钮-->
    12 <!--选择输入-->
    13 <input type="redio" name="" checked="checked" value="" />    <!--name是用来分组的,checked是默认值,value是命名按钮名字的-->
    14 <input type="checkbox" name="" checked="checked" value=""/>    <!--复选或者是多选-->
    15 <input type="file" />    <!--上传图片-->
    16 <select>    <!--下拉菜单-->
    17 <option value="值">内容</option>
    18 <option value="值">内容</option>
    19 <option value="值">内容</option>
    20 <option value="值">内容</option>
    21 </select>
    22 </form>

    以上就是咱们需要记住的一点东西

    看起来很复杂、很麻烦

    咱们来理一下思路

    总共分为三大类,每类分为四种,抛出textareaselect剩下的都是input tpye= 这个样式开头的

    那 文本类的就是下面的四个

    input type="text"

    .................password

    .................hidden

    <textarea><textarea/>

    按钮类的

    input type="submit"

    ..................button

    ..................reset

    ..................image

    选择输入

    input type="redio"

    ..................checkbox

    ..................file

    <select><option></option></select>

    最后后咱们来补充一个,小内容,关于选择类和按钮类的综合体

    咱们在一些网站去注册的帐号的时候,咱们选择选项比如说男、女,不一定非要点击按钮才可以,点击汉字也能选择的上,那这个小技巧是什么,咱们往下看

    <lable for="id">按钮内容</lable>

    1 <input type="redio" name="" checked="checked" value="男" id="001"/>
    2 <lable for="001"></lable>

    那这样咱们去点击前面的按钮也可以,点击这个字“男”也可以选择上,省去了鼠标、触摸板使用时的很多不必要的麻烦

  • 相关阅读:
    Python中使用PyMySQL
    python实现通用json导入到mysql
    python实现通用excel导入到mysql
    java优化几个小步骤
    日志添加request-id
    Nginx优化
    tomcat8 性能优化参考
    excel空格处理
    spring boot swagger ui使用 nginx 部署后无法使用问题
    Swagger2多包扫描
  • 原文地址:https://www.cnblogs.com/TheJoker/p/6604238.html
Copyright © 2020-2023  润新知