留言板功能前端样式代码
时间: 2023-09-05 22:08:34 浏览: 44
以下是一个简单的留言板前端样式代码,你可以根据自己的需求进行修改和调整:
```html
<!DOCTYPE html>
<html>
<head>
<title>留言板</title>
<style type="text/css">
body {
font-family: Arial;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
h1 {
text-align: center;
margin-top: 0;
font-size: 36px;
color: #333;
}
form {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}
label, textarea {
display: block;
width: 100%;
margin-bottom: 10px;
}
input[type="submit"] {
background-color: #333;
color: #fff;
border: none;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #222;
}
.message {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
background-color: #f9f9f9;
}
.message h3 {
margin-top: 0;
font-size: 18px;
color: #333;
}
.message p {
margin-top: 0;
font-size: 14px;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>留言板</h1>
<form action="" method="post">
<label for="name">姓名:</label>
<input type="text" name="name" id="name" required>
<label for="email">邮箱:</label>
<input type="email" name="email" id="email" required>
<label for="message">留言:</label>
<textarea name="message" id="message" rows="5" required></textarea>
<input type="submit" value="提交留言">
</form>
<div class="messages">
<div class="message">
<h3>张三</h3>
<p>这是一条留言。</p>
</div>
<div class="message">
<h3>李四</h3>
<p>这是另一条留言。</p>
</div>
</div>
</div>
</body>
</html>
```