练习:仿小米静态登录页面

效果图:

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .father {
            margin: 50px auto;
        }
        .pic {
            /* 设置背景颜色、插入图片、图片不重复、图片居中 */
            background: #ff5b00 url(use/mi-logo.png) no-repeat center center;
            width: 50px;
            height: 50px;
            /* 图标边角的圆弧度 */
            border-radius: 5%;
            margin: auto;
        }
        .title {
            margin-top: 20px;
            /* 其内子元素是h1,我转化为行内块,方便居中 */
            text-align: center;
        }
        h1 {
            /* 字体不加粗 */
            font-weight: 400;
            /* 块元素转化为行内块 */
            display: inline-block;
        }
        .uname,.pwd {
            width: 330px;
            height: 50px;
            /* 重置边框的边框样式 */
            border: 1px #e6e6e6 solid;
            margin-top: 15px;
            /* 设置内边距,使输入框内的字体距离左边框20px */
            padding-left: 20px;
        }
        .input {
            margin-top: 30px;
            /* 其内三个都是表单元素,也就是行内元素,用text-align设置居中 */
            text-align: center;
        }
        button {
            width: 356px;
            height: 50px;
            background-color: #ff5b00;
            color: white;
            margin-top: 20px;
            /* 按钮自带边框线,border:none去掉默认边框 */
            border: none;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="pic"></div>
        <div class="title">
            <h1>小米账号登录</h1>
        </div>
        <div class="input">
            <input type="text" placeholder="邮箱/手机号码/小米ID" class="uname"><br>
            <input type="password" placeholder="密码" class="pwd"><br>
            <button>登录</button>
        </div>
        
    </div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值