凹显风登录页面(2)

HTML代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>凹显风登录页面</title>
    <link rel="stylesheet" href="./css/02-凹显风登录页面.css">
</head>

<body>
    <div class="box">
        <h1>登&nbsp;录</h1>

        <div class="login_box">
            <div class="user">
                <input type="text" placeholder="请输入用户名">
                <span></span>
            </div>

            <div class="password">
                <input type="password" placeholder="请输入密码">
                <span></span>
            </div>

            <div class="remember">
                <span class="left">
                    <!--  label标签的for属性与相关元素的id属性相同 -->
                    <input type="checkbox" name="re" id="re" /> <label for="re">记住我</label>
                </span>

                <span class="right"><a href="#">忘记密码?</a></span>
            </div>

            <button>登录</button>
        </div>
    </div>
</body>

</html>

CSS代码:

​
@font-face {
    font-family: 'icomoon';
    src: url('fonts/icomoon.eot?xs5t2x');
    src: url('fonts/icomoon.eot?xs5t2x#iefix') format('embedded-opentype'),
        url('fonts/icomoon.ttf?xs5t2x') format('truetype'),
        url('fonts/icomoon.woff?xs5t2x') format('woff'),
        url('fonts/icomoon.svg?xs5t2x#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

* {
    margin: 0;
    padding: 0;
}

body {
    background: url(../image/star2.jpg) no-repeat;
    background-size: cover;
}

/* 登录大盒子 */
.box {
    width: 450px;
    height: 300px;
    background-color: rgba(0, 0, 0, .2);
    box-shadow: 8px 8px 10px rgba(0, 0, 0, .4);
    margin: 10% auto;
    text-align: center;
    color: aliceblue;
}

/* 登录标题 */
.box h1 {
    padding: 15px 0;
}

/* 用户名 密码 记住我部分 */
.user,
.password,
.remember {
    position: relative;
    width: 200px;
    margin: 0 auto;
    margin-bottom: 10px;
}

.user input,
.password input {
    padding-left: 5px;
    width: 200px;
    height: 25px;
    font-size: 12px;
    outline: none;
}

.remember {
    height: 15px;
    font-size: 8px;
}

.left {
    padding-left: 10px;
    float: left;
}

.right {
    float: right;
}

.right a {
    color: #fef9f9;
    text-decoration: none;
}

/* 登录提交按钮 */
button {
    width: 100px;
    background-color: #fef9f9;

}

input:hover,
button:hover {
    box-shadow: 5px 5px 5px rgba(0, 0, 0, .4);
}

.user span,
.password span {
    font-family: 'icomoon';
    position: absolute;
    top: 6px;
    right: 0;
    font-size: 14px;
    color: #bfbebe;
}

​

登录页面:

背景图片: 

 

字体图标的引入:

  1. 下载:icomoon字库 / 阿里 iconfont字库
  2. 把下载包里面的fonts文件夹放入页面根目录
  3.  在CSS样式中全局声明字体   把style.css中的@font-face复制到css中
  4.  html里复制小图标
  5.  给html里带有小图标的标签指定一个字体(2中复制过来的代码有     font-family: 'icomoon';)
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值