登陆界面html

<!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>建议登陆页面</title>

    <style>

        body{background: url(img/登录.jpg);

            background-repeat: no-repeat;

             background-size: 100%;

             font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;}

        #container{

            max-width:400px;

            margin: 0 auto;

            padding: 20px;

            background-color: #fff;

            border-radius: 5px;

            box-shadow: 0 0 10px rgba(0, 0, 0, 1);margin-top: 100px;}

        h1{text-align: center;}

        input[type="text"],input[type="password"]{

            width: 95%;

            padding: 10px;

            margin-bottom: 10px;

            border: 1px solid #ccc;

            border-radius: 5px;

        }

        input[type="submit"]{

            width: 100%;

            padding: 10px;

            background-color: #4caf50;

            color: #fff;

            border: none;

            border-radius: 5px;

            cursor: pointer;

        }

        .forgot-password{

            text-align: right;

            margin-bottom: 10px;

        }

    </style>

</head>

<body>

    <div id="container">

        <h1>登录</h1>

        <form action="index.html" method="post">

            <input type="text" id="username" placeholder="用户名/邮箱">

            <input type="password" id="password" placeholder="密码">

            <label>

                <input type="checkbox">记住我

            </label>

            <div class="forgot-password">

                <a href="#">忘记密码</a>

            </div>

            <input type="submit" value="登录" οnclick="return denglu()">

        </form>

        <script type="text/javascript">

            function $(id){return document.getElementById(id)}

            function denglu(){

                var user=$("username").value;

                var pass=$("password").value;

                if(user==="admin"&&pass==="123456")

                {

                alert("用户名是:"+(document.getElementById("username").value)+

                "密码是:"+(document.getElementById("password").value))

                return true;

            }

                else{alert("账号密码错误,请重新输入")

                return false;

            }

               

               

            }

        </script>

    </div>

   

</body>

</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值