简单的登录页面制作-02

前言

        在上一篇文章中,我们学习了基本的HTML的标签使用,以及基础的CSS样式设置,现在我们就来做一个简单的登录页面吧。

HTML部分

        html部分较为简单,链接样式文件,定义表单即可。

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>登录页</title>  <!-- 页面标题 -->
        <!-- 链接css样式文件 -->
        <link rel="stylesheet" type="text/css" href="lgstyle.css" />
    </head>
    <body>
    <div>
        <form action="">
             <h1>网站管理系统</h1>
            <input type="text" id="name" placeholder="账号"><br />
            <input type="password" id="pass" placeholder="密码"><br />
            <input type="button" onclick="check(this)" value="登录">
            <p>
        </form>
    </div>
    </body>
</html>

        运行后得到一个比较简单的初始页面。

        我们在通过编写css样式来美化这个页面。

CSS部分


/*网页背景样式设置  */
html{
    background-image: url(login.png);
    background-repeat: no-repeat;
    background-size: 100%;
}


/*表单样式设置*/
form{
    text-align: center;
    position: absolute;   /*表单于页面居中*/
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
 
/*输入框样式设置*/
input[type=text],input[type=password]{
    background-color: white;  /*正常状态样式*/
    color: black;
    border: 0;
    border-radius: 20px;
    outline: 0;
    text-align: center;
    height: 50px;
    width: 250px;
    margin: 5px;
}
 
 /*登录按钮样式设置*/
input[type=button]{
    background-color: #45A0F2;  /*正常状态样式*/
    color: white;
    border: 0;
    border-radius: 20px;
    outline: none;
    text-align: center;
    height: 50px;
    width: 250px;
    margin: 5px;
}
 
/*输入框悬停时样式设置*/
input[type=text]:hover,input[type=password]:hover{
    outline: 0;  /*悬停时样式*/
    background-color: #65BCD6;
    color: white;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.45), 0 6px 20px 0 rgba(0,0,0,0.19);  /*阴影*/
}
 
/*登录按钮悬停时样式设置*/
input[type=button]:hover{
    outline: 0;  /*悬停时样式*/
    background-color:#168DBE;
    color: white;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.45), 0 6px 20px 0 rgba(0,0,0,0.19);  /*阴影*/
}

        这样一个简单的静态登录页面就完成了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值