-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path杨妃-20281157.html
86 lines (75 loc) · 1.85 KB
/
杨妃-20281157.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<head>
<title>作业1登录页面</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
width: 300px;
margin: auto;
margin-top: 200px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
font-size: 26px;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 7px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type="button"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="button"]:hover {
background-color: #45a049;
}
.message {
text-align: center;
margin-top: 20px;
}
</style>
<script>
function login() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
// 检查用户名和密码是否符合要求
if (username === "yangfei" && password === "testpasswd") {
alert("登录成功!");
} else {
document.getElementById("message").innerHTML = "用户名或密码不正确,请重新输入。";
}
}
</script>
</head>
<body>
<div class="container">
<h1>用户登录</h1>
<label for="username">账号:</label>
<input type="text" id="username" name="username">
<label for="password">密码:</label>
<input type="password" id="password" name="password">
<input type="button" value="登录" onclick="login()">
<p class="message" id="message"></p>
</div>
</body>
</html>