写一个只有表单的进行页面美化后的html
时间: 2023-08-01 17:09:35 浏览: 44
好的,以下是一个简单的表单页面示例,经过了一些基本的样式美化:
```html
<!DOCTYPE html>
<html>
<head>
<title>表单页面美化示例</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
color: #333;
margin: 0;
padding: 0;
}
h1 {
font-size: 2rem;
text-align: center;
margin: 2rem;
}
form {
max-width: 500px;
margin: 0 auto;
border: 1px solid #ccc;
background-color: #fff;
padding: 2rem;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
label {
font-size: 1.2rem;
display: block;
margin-bottom: 0.5rem;
}
input[type="text"], input[type="email"], select {
display: block;
width: 100%;
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 3px;
font-size: 1rem;
color: #333;
}
input[type="submit"] {
background-color: #333;
color: #fff;
padding: 0.5rem 1rem;
border: none;
border-radius: 3px;
font-size: 1.2rem;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #555;
}
</style>
</head>
<body>
<h1>表单页面</h1>
<form>
<label>姓名</label>
<input type="text" name="name" placeholder="请输入你的姓名" required>
<label>邮箱</label>
<input type="email" name="email" placeholder="请输入你的邮箱" required>
<label>性别</label>
<select name="gender">
<option value="male">男</option>
<option value="female">女</option>
<option value="other">其他</option>
</select>
<input type="submit" value="提交">
</form>
</body>
</html>
```
这个页面使用了简单的CSS样式来美化表单,包括背景颜色、字体、边框、圆角等。同时,也添加了一些交互效果,例如提交按钮的鼠标悬停效果等,让表单看起来更加美观和易用。