用html做一个登录页面。要求:用动态流星背景,可以跳转到其他页面
时间: 2024-03-29 20:37:28 浏览: 16
好的,以下是一个简单的登录页面的 HTML 代码,其中包含了动态流星背景和跳转链接。
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-color: #000;
color: #fff;
font-family: Arial, sans-serif;
font-size: 16px;
}
.stars {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000 url("https://cdn.rawgit.com/AstronomicalObjects/stars.js/master/images/starfield.png") repeat top center;
z-index: -1;
}
form {
margin: 100px auto;
max-width: 400px;
padding: 20px;
border-radius: 10px;
background-color: rgba(255,255,255,0.8);
}
input[type="text"], input[type="password"] {
display: block;
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
font-size: 18px;
background-color: #eee;
}
input[type="submit"] {
display: block;
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="stars"></div>
<form action="welcome.html">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Login">
</form>
</body>
</html>
```
该代码使用了一个名为“stars”的CSS类来创建了动态流星背景,同时在表单中添加了一个提交按钮,用于登录。当用户点击提交按钮时,该页面将跳转到名为“welcome.html”的页面。
注意:这只是一个简单的示例代码,实际应用中可能需要更多的安全性和验证措施。