zoukankan      html  css  js  c++  java
  • 雪碧图实现登陆页面

    这是素材:

    这是代码:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
        .logn{
            height: 260px;
            width: 230px;
            margin: 0 auto;
            border: 1px solid black;
            background-color: rgb(200, 223, 230);
        }
        .box1{
            height: 35px;
            width: 190px;
            margin: 10px;
        }
        .chose{
            font-size: 12px;
            color: gray;
            display: inline-block;
            height: 13px;
            line-height: 13px;
        }
        .tips{
            float: right;
            color: blue;
            font-size:12px;
        }
        button{
            background-image: url("index.jpg");
            height: 35px;
            width: 190px;
            margin: 10px;
        }
        .lognin{
            background-position: 0 -3px;
        }
        .lognon{
            background-position: 0 -40px;
        }
        hr{
            color: gray;
            margin: 0;
        }
        </style>
    </head>
    <body>
        <div class="logn">
            <form>
            <input class="box1" type="text" placeholder="邮箱/手机号/用户名"/>
            <br/>
            <input class="box1" type="password" placeholder="请输入密码"/>
            <br/>
            <input type="checkbox">
            <span class="chose">下次自动登陆</span>        
            <span class="tips">忘记密码</span>
            <br/>
            <button class="lognin"></button>
            <hr/>
            <button class="lognon"></button>
        </form>
        </div>
        
    </body>
    </html>

    这是效果:

    总结一下: 雪碧图就是把网页要用的小图放在一起,需要的时候直接选取所在的位置,减少服务器请求次数。

  • 相关阅读:
    Unity 预处理命令
    Unity 2DSprite
    Unity 生命周期
    Unity 调用android插件
    Unity 关于属性的get/set
    代码的总体控制开关
    程序员怎么问问题?
    VCGLIB 的使用
    cuda实践(1)
    python之json文件解析
  • 原文地址:https://www.cnblogs.com/sandraryan/p/10868669.html
Copyright © 2011-2022 走看看