用html5和css和js做一个简单的登录注册页面
时间: 2024-01-30 19:02:02 浏览: 15
好的,下面是一个简单的登录注册页面的示例代码:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录注册页面</title>
<style>
form {
display: flex;
flex-direction: column;
align-items: center;
}
label {
margin-top: 10px;
}
input {
margin-top: 5px;
padding: 5px;
border-radius: 5px;
border: 1px solid grey;
}
button {
margin-top: 10px;
padding: 5px 10px;
border-radius: 5px;
border: none;
background-color: blue;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<h1>登录注册页面</h1>
<h2>登录</h2>
<form>
<label for="username">用户名:</label>
<input type="text" id="username" name="username">
<label for="password">密码:</label>
<input type="password" id="password" name="password">
<button type="submit">登录</button>
</form>
<h2>注册</h2>
<form>
<label for="new_username">用户名:</label>
<input type="text" id="new_username" name="new_username">
<label for="new_password">密码:</label>
<input type="password" id="new_password" name="new_password">
<label for="confirm_password">确认密码:</label>
<input type="password" id="confirm_password" name="confirm_password">
<button type="submit">注册</button>
</form>
<script>
// TODO: 添加表单提交的逻辑
</script>
</body>
</html>
```
这个页面包含了一个登录表单和一个注册表单,使用了一些简单的 HTML5、CSS 和 JavaScript 技术。其中,HTML5 用于构建页面结构,CSS 用于样式美化,JavaScript 用于处理表单提交等逻辑。你可以根据自己的需要进行修改和扩展。注意,这只是一个简单的示例,实际的登录注册页面需要考虑更多的安全性和用户体验问题。