首页 > 其他分享 >简单的登录的响应式

简单的登录的响应式

时间:2024-01-14 16:13:37浏览次数:23  
标签:box 登录 width top height padding 响应 简单 margin

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="axios.js"></script>
</head>
<style>
    body {
        background: linear-gradient(to right,#65CBF7, #B3A5Fc);
        width: 100vw;
        height: 100vh;
        margin: 0;
    }
    .box{
        width:60%;
        height:450px;
        display:flex;
        position:fixed;
        box-shadow:0 5px 15px rgba(0,0,0,.8);
        top:50%;
        left:50%;
        transform:translate(-50%,-50%);
    }
    .left{
        width:65%;
    }
    .left>img{
        display: block;
        width:100%;
        height: 100%;
        object-fit:cover;
    }
    .right{
        width:35%;
        height:100%;
        background-color:#FFF;
        box-sizing:border-box;
        padding:0 20px;
    }
    h1{
        text-align:center;
        padding-top:45px;
        margin-top:0;
    }
    .inputItem{
        height:44px;
        padding:0;
        padding-left:5px;
        width: 100%;
        border:none;
        background:none;
        outline:none;
        border-bottom :3px solid #B3A5Fc;
        font-size:18px;
        margin-top:20px;
    }
    .forgetPassword{
        margin-top:25px;
        text-align:right;
        display:block;
        color:#9C3493
    }
    .btn{
        background:linear#63CBF7;
        color:#9C3493;
        font-weight:bold;
        border:none;
        border-radius:30px;
        height:46px;
        width:80%;
        font-size:18px;
        display:block;
        margin:auto;
        margin-top:30px;
    }
    /*适配pc*/
    @media screen and (min-width:960px){
        .box{
            max-width: 950px;
            min-width: 750px;
        }
    }
    /*适配ipad*/
    @media screen and (max-width:960px){
        .box{
            display: block;
            height:auto;
        }
        .left,.right{
            width:100%;
            margin-top:0;
        }
        .left{
            height: 200px;
        }
        .right{
            padding:2vw 2vw;
        }
        h1{
            padding-top:0;
            margin-bottom:1vw;
        }
        .inputItem,.forgetPassword,.btn{
            margin-top:2vw;
        }
    }/*适配移动*/
    @media screen and (max-width:750px){
        .box{
            width: 85%;
        }
    }
</style>
<body>
    <div class="box">
        <div class="left">
            <img src="https://tse3-mm.cn.bing.net/th/id/OIP-C.1-gK-0q-yD7XIxKBU2usdQHaDt?w=323&h=175&c=7&r=0&o=5&dpr=1.3&pid=1.7" alt="">
        </div>
        <div class="right">
            <h1>Login</h1>
            <input type="text"  class="inputItem" placeholder="your userName">
            <input type="password" class="inputItem" placeholder="your password">
            <a href="#" class="forgetPassword">forget password</a>
            <button class="btn" onclick="Login()">Login</button>
        </div>
    </div>
</body>
<script>
    function Login(){
        let userName=document.getElementsByClassName('inputItem')[0].value;
        let password=document.getElementsByClassName('inputItem')[1].value;
        let emp={userName:userName,password:password};
        axios.post("http://localhost:8080/login",emp).then((result)=>{
            let code=result.data.code;  //验证登录
            if(code){
                window.location.href=""  //登录后跳转页面
            }else {
                alert("用户名或密码错误");
            }
        })

    }
</script>
</html>

 

标签:box,登录,width,top,height,padding,响应,简单,margin
From: https://www.cnblogs.com/luo9tian/p/17963813

相关文章

  • 网络爬虫-处理cookie登录的问题,seesion的用法
    一、以17k的小说网的登录为例,网址小说_17K小说网|最新小说下载-一起免费看小说当想要在小说网中看一下书架上的书都有哪些,必须得先登录一个账户才能看到,不同的用户登录看到内容也是不一样的,服务器是如何区分的呢?这里要引入cookie,不同的用户访问到服务器的时候,除了访问地......
  • 一个简单的Linux系统加固方案
    一、系统默认帐号及组管理删除系统默认不使用的帐号,包括:lp、mail、games、ftp、nobody、postfix等。删除系统默认不使用的组,包括:mail、games、ftp、nobody、postfix等。二、启用密码策略1.密码60天过期,修改密码最小间隔为1天,最短密码要求8位,在密码过期前7天内通知用户。通过修改/e......
  • 两种方法实现Linux不活动用户登录超时后自动登出
    在平常的工作中,windows系统使用的比较多一些,身边的很多同事都会对自己的电脑进行一些个性化设置,比如离开一段时间后自动锁屏、自动关闭屏幕、自动注销当前登录等。在windows下可以这样操作,那么在Linux下是否也可以这样操作呢?经过一段时间的摸索,本人发现了2中方法来实现Linux下不活......
  • dremio dbt + nessie 集成profile 简单说明
    我最近写了一个简单的关于dremio集成nessie以及dbt玩法的说明,以下简单说明下dbt如何配置配置说明对于配置实际上与以前一些介绍类似,集成nessie的使用与其他是类似的,只是集成nessie之后我们的数据开发模型上就有了实际的版本了(dbt集成git之后也会包含版本,是属于模型代码......
  • 简单小结类与对象
    类与对象类是一个模板(抽象),对象是一个具体的实例方法定义、调用!对应的引用引用类型;基本类型(8)对象是通过引用来操作的:栈-->堆属性:字段Field成员变量默认初始化:数字:00.0char:u0000boolean:false引用:null修饰符属性类型属性名=......
  • 类模板实现简单的数组
    //Myarray.hpp#pragmaoncetemplate<classT>classMyArray{public: MyArray(intcapacity){ this->mCapacity=capacity; this->msize=0; this->p=newT[this->mCapacity]; } //copy MyArray(constMyArray&arr){ this->......
  • 短视频商城系统,session和cookie实现登录
    短视频商城系统,session和cookie实现登录项目准备1.登录页面的login.html2.主页index.html3.处理登录的方法4.获取session中数据的方法5.过滤器登录页面在static目录下新建一个文件叫做login.html<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8">......
  • 简单说一下mybatis的多表映射的使用
    MyBatis是一种流行的Java持久层框架,它提供了一种简单而强大的方式来进行数据库操作。在MyBatis中,多表映射是指将数据库中多个关联表之间的数据映射到Java对象中的过程。MyBatis提供了多种方式来实现多表映射,下面是其中两种常用的方法:使用嵌套查询(NestedQueries):这是一......
  • Simple CTF-简单CTF
    首先对靶机进行端口扫描nmap-sV-p-10.10.70.110通过扫描结果可以看出靶机开放了21端口vsftpd服务、80端口apache服务、2222端口openssh服务这里我们的思路是匿名用户登录ftp,获取一些有用的文件80端口目录扫描,robots文件,指纹识别ssh爆破经过我的尝试ftp无法正常执行......
  • 简单易用的 MySQL 官方压测工具
    一、MySQL自带的压力测试工具Mysqlslapmysqlslap是mysql自带的基准测试工具,该工具查询数据,语法简单,灵活容易使用.该工具可以模拟多个客户端同时并发的向服务器发出查询更新,给出了性能测试数据而且提供了多种引擎的性能比较。mysqlslap为mysql性能优化前后提供了直观的验证依据......