html留言板页面设计
时间: 2023-12-08 19:39:19 浏览: 23
以下是一个简单的HTML留言板页面设计的例子:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>留言板</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
.container {
margin: 0 auto;
max-width: 800px;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
h1 {
text-align: center;
color: #333;
}
form {
margin-top: 20px;
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"], textarea {
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 20px;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
input[type="submit"] {
background-color: #333;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #555;
}
.message {
margin-top: 20px;
padding: 20px;
background-color: #f2f2f2;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.message h2 {
margin-top: 0;
color: #333;
}
.message p {
margin-bottom: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>留言板</h1>
<form>
<label for="name">姓名:</label>
<input type="text" id="name" name="name" required>
<label for="message">留言:</label>
<textarea id="message" name="message" rows="5" required></textarea>
<input type="submit" value="提交">
</form>
<div class="message">
<h2>张三</h2>
<p>今天天气真好!</p>
</div>
<div class="message">
<h2>李四</h2>
<p>我也觉得今天天气不错。</p>
</div>
</div>
</body>
</html>
```