设计一套白色背景的表单html
时间: 2024-03-20 12:40:45 浏览: 21
好的,下面是一套简单的白色背景表单html代码:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>白色背景表单</title>
<style>
body {
background-color: #fff;
font-family: Arial, sans-serif;
}
form {
margin: 0 auto;
padding: 20px;
max-width: 500px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
display: block;
margin-bottom: 20px;
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
}
input[type="submit"] {
background-color: #007bff;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #0069d9;
}
</style>
</head>
<body>
<form>
<label for="name">姓名</label>
<input type="text" id="name" name="name" required>
<label for="email">邮箱</label>
<input type="email" id="email" name="email" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<label for="message">留言</label>
<textarea id="message" name="message" rows="5" required></textarea>
<input type="submit" value="提交">
</form>
</body>
</html>
```
以上代码中,我们设置了一个白色背景的表单,包括输入姓名、邮箱、密码和留言等信息,并设置了提交按钮。同时,我们还为表单设置了一定的样式,包括字体、背景色、边框、圆角等。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)