注册表单模板是一种用于收集用户信息的网页界面设计。CSS(层叠样式表)是用于描述HTML文档样式的语言,可以用来美化注册表单,使其外观更具吸引力。
以下是一个简单的简约风格注册表单模板的CSS代码示例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>注册表单</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
width: 300px;
margin: 100px auto;
background: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.form-group input {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 3px;
}
.form-group input:focus {
border-color: #007BFF;
outline: none;
}
.btn {
width: 100%;
padding: 10px;
background-color: #007BFF;
border: none;
border-radius: 3px;
color: #fff;
font-size: 16px;
cursor: pointer;
}
.btn:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<form action="#" method="post">
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="email">邮箱</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" class="btn">注册</button>
</form>
</div>
</body>
</html>通过以上方法,可以创建一个美观且功能齐全的注册表单模板。
没有搜到相关的文章