• html基础


    ## HTML
    - 每个标签都有自己独特的能力 <input> 输入框 <h2>
    - 标签中通过属性也可以获取某种能力

    - input 输入框
    - h2 标题
    - div 分块,换行
    - a 链接
    - img 图片
    - checkbox radio 多选、单选
    - id
    - name
    - form 表单格式
    - table(表格)
    - ul
    - iframe 子网页


    如何传参给后端
    <form action="http://httpbin.org/post" method="post">
    
        <div>
            性别:<input type="radio" name="gender" value="man"><input type="radio" name="gender" value="girl"><input type="radio" name="gender" value="unknown">未知
    <!--        这是另一个选择器-->
            <input type="radio" name="aaa">男女
        </div>
    </form>

    第一行发起post请求,div里相当于{"gender":"man", "gender":"girl", "gender":"unknown",},从name属性中获取键名,value中获取值。

    示例html:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>py44</title>
    </head>
    <body>
    
    <!--    标题-->
        <h2>登录</h2>
    
        <form action="http://httpbin.org/post" method="post">
    <!--    输入用户名-->
        <div>用户名:<input name="username"></div>
    <!--输入密码-->
        <div>密码:<input type="password" name="pass"></div>
    <!--    单选框-->
        <div>
            性别:<input type="radio" name="gender" value="man"><input type="radio" name="gender" value="girl"><input type="radio" name="gender" value="unknown">未知
    <!--        这是另一个选择器-->
            <input type="radio" name="aaa">男女
        </div>
    
        <div>
            喜欢的电影:<input type="checkbox" name="movie" value="zhanlang">战狼
            <input type="checkbox" name="movie" value="honghai">红海行动
            <input type="checkbox" name="movie" value="shuofu">说服
        </div>
            <div><input type="file" name="avatar"></div>
    
    
        <!--提交-->
        <div><input type="submit"></div>
        </form>
    
    <!--    <a href="http://www.baidu.com">-->
    <!--        <img src="resume.png" width="400px" height="300px">-->
    <!--    </a>-->
    
        <iframe src="http://www.testingpai.com" width="800px" height="600px"></iframe>
    
    
    </body>
    </html>
  • 相关阅读:
    HTML5中表单的创建
    防冲撞协议原理实验报告
    yii2.0 Activeform表单部分组件使用方法 [ 2.0 版本 ]
    Yii正则验证
    Yii2用Gii自动生成Module+Model+CRUD
    yii2框架安装运行init.bat报错php.exe不是内部或外部命令
    YII2.0安装教程,数据库配置前后台 [ 2.0 版本 ]
    ignore_user_abort函数制定计划任务
    php 常用的系统函数
    php常用字符串处理函数
  • 原文地址:https://www.cnblogs.com/wsfsd/p/15585335.html
Copyright © 2020-2023  润新知