html+css 漂亮的登陆界面

7 篇文章 0 订阅

Login.html

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="wrapper">
    <div class="header">Login to <span>iyaq</span></div>
    <form action="" method="post">
        <ul>
            <li>
                <div class="text">
                    <span class="yonghu"></span><input type="text" placeholder="请输入用户名">
                </div>
            </li>
            <li>
                <div class="password">
                    <span class="mima"></span><input type="password" placeholder="请输入密码">
                </div>
            </li>
            <li class="remember">
                <input type="checkbox">记住我
            </li>
            <li>
                <a href="">忘记我</a>
            </li>
            <li>
                <input type="button" value="登陆">
            </li>
        </ul>
    </form>
    <div class="footer">
        <p>iyaq Personal Blog  <a href="">Copyright ©2012 Wang Yuyan</a></p>
        <p><a href="">iiyaq Home</a> | <a href="">Bolg
        </a> | <a href="">Work</a> | <a href="">Terms of Use</a> | <a href="">Contact Me</a></p>
    </div>
</div>
</body>
</html>

style.css

@font-face {
    font-family: 'iconfont';
    src: url('//at.alicdn.com/t/font_1463147324_946932.eot'); /* IE9*/
    src: url('//at.alicdn.com/t/font_1463147324_946932.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
    url('http://at.alicdn.com/t/font_1463147324_946932.woff') format('woff'), /* chrome、firefox */
    url('http://at.alicdn.com/t/font_1463147324_946932.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
    url('//at.alicdn.com/t/font_1463147324_946932.svg#iconfont') format('svg'); /* iOS 4.1- */
}

*{margin: 0;padding: 0}
li{list-style: none;}
form a{text-decoration: none;}
html,body {
    background: #fff;
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
}
.wrapper{text-align: center;}
.header{
    font-size: 25px;
    font-family: 微软雅黑;
    color: rgb(98,94,91);
}
.header span{
    font-size: 30px;
    font-family: "Brush Script Std";
}
form{
    background: url(input-bg.png);
    width: 260px;
    height: 260px;
    margin: 35px auto;
    padding: 30px;
    box-shadow:0px 1px 2px 1px #aaaaaa,
    inset 0px 1px 1px rgba(255,255,255,0.7);
    border-radius: 3px;
}
form ul{
    width: 100%;
    height: 100%;
    text-align: left;
    display: flex;
    flex-flow: column nowrap;
    justify-content: space-between;
}
ul li div{
    width: 260px;
    height: 40px;
    background: #e1dcd8;
    color: rgb(98,94,91);
    box-shadow: inset 0px 2px 5px #aaaaaa;
    border-radius: 5px;
    position: relative;
}
ul li .yonghu{
    font-family: iconfont;
    position: absolute;
    top: 12px;
    left: 10px;
}
ul li .mima{
    font-family: iconfont;
    position: absolute;
    top: 12px;
    left: 10px;
}
ul li div input{
    height: 40px;
    width: 190px;
    padding: 0 35px;
    border: none;
    background: #e1dcd8;
    color: rgb(98,94,91);
    box-shadow:
            0px 1px 1px rgba(255,255,255,0.7),
            inset 0px 2px 5px #aaaaaa;
    border-radius: 5px;
}
ul li input:focus{
    outline: none;
    background: #f5f2ef;
}
ul .remember{
    font-size: 14px;
    font-family: 微软雅黑;
    font-weight: bold;
    color: rgb(98,94,91);
    position: relative;
    display: flex;
    justify-content: center;
}
ul .remember input[type*="checkbox"]{
    width: 20px;
    height: 20px;
    vertical-align: super;
    margin-right: 12px;
}
.remember label {
    cursor: pointer;
    position: absolute;
    width: 22px;
    height: 22px;
    top: 7px;
    left: 0;
    background: #eee;
    border:1px solid #cccccc;
    border-radius: 4px;

}
/*Display the tick inside the checkbox*/
.remember label:after {
    opacity: 0.4;
    content: '';
    position: absolute;
    width: 12px;
    height: 5px;
    background: transparent;
    top: 6px;
    left: 4px;
    border: 3px solid #74884a;
    border-top: none;
    border-right: none;

    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    transform: rotate(-45deg);
}
/*Create the hover event of the tick*/
.remember label:hover::after {
    opacity: 0.7;
}
/*Create the checkbox state for the tick*/
.remember input[type=checkbox]:checked + label:after {
    opacity: 1;
    border-color: #74884a;
}
ul li a{
    font-size: 14px;
    font-family: 黑体;
    color: rgb(152,142,135);
    display: flex;
    justify-content: center;
}
ul li input[type*="button"]{
    width: 100%;
    height: 40px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    color: #ffffff;
    background: -moz-linear-gradient(
            top,
            #94aa64 0%,
            #7a924a 50%,
            #607738);
    background: -webkit-gradient(
            linear, left top, left bottom,
            from(#94aa64),
            color-stop(0.50, #7a924a),
            to(#607738));
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    border: 1px solid #7d8862;
    -moz-box-shadow:
            0px 1px 0px rgba(170,170,170,1),
            inset 0px 1px 1px rgba(255,255,255,0.7);
    -webkit-box-shadow:
            0px 1px 0px rgba(170,170,170,1),
            inset 0px 1px 1px rgba(255,255,255,0.7);
    box-shadow:
            0px 1px 0px rgba(170,170,170,1),
            inset 0px 1px 1px rgba(255,255,255,0.7);
    text-shadow:
            0px -1px 0px rgba(000,000,000,0.3),
            0px 0px 0px rgba(255,255,255,0);
}
ul li input[type*="button"]:hover{
    opacity: 0.8;
}
ul li input[type*="button"]:active{
    width: 100%;
    height: 40px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    color: #ffffff;
    background: -moz-linear-gradient(
            top,
            #607738 0%,
            #7a924a 50%,
            #94aa64 );
    background: -webkit-gradient(
            linear, left top, left bottom,
            from(#607738),
            color-stop(0.50, #7a924a),
            to(#94aa64));
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    border: 1px solid #7d8862;
    -moz-box-shadow:
            0px -1px 0px rgba(170,170,170,1),
            inset 0px -1px 1px rgba(255,255,255,0.7);
    -webkit-box-shadow:
            0px -1px 0px rgba(170,170,170,1),
            inset 0px -1px 1px rgba(255,255,255,0.7);
    box-shadow:
            0px -1px 0px rgba(170,170,170,1),
            inset 0px -1px 1px rgba(255,255,255,0.7);
    text-shadow:
            0px 1px 0px rgba(000,000,000,0.3),
            0px 0px 0px rgba(255,255,255,0);
}
.footer{
    font-size: 12px;
    font-family: 黑体;
    color: rgb(98,94,91);
}
.footer a{
    color: rgb(152,142,135);
}
 

 

 

效果图:

  • 2
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以为您提供一些 HTMLCSS 代码来创建漂亮登录界面。以下是一个简单的示例: HTML 代码: ``` <!DOCTYPE html> <html> <head> <title>Login Page</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="login-box"> <h2>Login Here</h2> <form> <div class="user-box"> <input type="text" name="" required=""> <label>Username</label> </div> <div class="user-box"> <input type="password" name="" required=""> <label>Password</label> </div> <a href="#"> <span></span> <span></span> <span></span> <span></span> Submit </a> </form> </div> </body> </html> ``` CSS 代码: ``` body { margin: 0; padding: 0; font-family: sans-serif; background: linear-gradient(to right, #00C9FF, #92FE9D); } .login-box { width: 320px; height: 420px; background: #000; color: #fff; top: 50%; left: 50%; position: absolute; transform: translate(-50%, -50%); box-sizing: border-box; padding: 70px 30px; } h2 { margin: 0; padding: 0 0 20px; text-align: center; font-size: 22px; } .user-box { position: relative; } .user-box input { width: 100%; padding: 10px 0; font-size: 16px; color: #fff; margin-bottom: 30px; border: none; border-bottom: 1px solid #fff; outline: none; background: transparent; } .user-box label { position: absolute; top: 0; left: 0; padding: 10px 0; font-size: 16px; color: #fff; pointer-events: none; transition: 0.5s; } .user-box input:focus ~ label, .user-box input:valid ~ label { top: -20px; left: 0; color: #00bcd4; font-size: 12px; } a { text-decoration: none; display: inline-block; background: #00bcd4; color: #fff; padding: 10px 20px; margin-top: 40px; border-radius: 30px; transition: 0.5s; } a:hover { background: #fff; color: #00bcd4; } ``` 该代码将创建一个黑色背景的登录框,其中包括一个标题、“用户名”和“密码”输入框以及一个提交按钮。您可以根据需要进行调整。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值