用html和css写登陆页面并且跳转网站

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="login.css">
</head>
<body>
<form action="2.学生信息管理.html" method="post">
<div id="login">
    <span >
        <h1 id="lo">学生信息管理系统</h1>
    </span>
    
<div id="use">账号
<input text="text" id="user" required placeholder="请输入用户名" >
</div>
<br>
<div id="psw">密码
<input text="password" id="password" required placeholder="请输入密码" >
</div>
<br>
<br>
<button type="submit" onclick="myFunction()" id="butt">登录</button>
</div>
</form>
</body>
<script>
<!--    登陆验证-->
    function myFunction() {
      if (document.getElementById("user").value == "a") {
        if (document.getElementById("password").value == "1") {
          alert("登录成功");
        }
        else {
          alert("密码错误");
        }
      }
      else {
        alert("账号密码都错");
      }
    }
    </script>
  </body>
  </html>

2.cs

body{
    /*初始化 */
    margin: 1;
    padding: 0;
    
}
#login{
    border:1px solid rgb(18, 205, 205);
    width: 500px;
    height: 389px;
    /* 固定定位,浏览器怎么滑动,这个块都不变 */
    position: fixed;
    right: 80px;
    top: 150px;
    /* background-color: #68a3c6;
    background-image: linear-gradient(160deg, #68a3c6 0%, #80D0C7 100%);
     */
}
#lo{
   
    width:500px;
    text-align:center;
    font-size: 50px;
   
}
#use,#psw{
    
    width:70px;
    text-align:center;
    font-size: 25px;
}
#user,#password{
  
    width:300px;
    text-align:center;
    font-size: 25px;
}
#butt{
    width:500px;
    height: 60px;
    text-align:center;
    font-size: 20px;
}

  • 4
    点赞
  • 50
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值