给我写一个货代网页的代码
时间: 2023-11-27 20:50:56 浏览: 34
以下是一个简单的货代网页的代码示例:
```
<!DOCTYPE html>
<html>
<head>
<title>货代网站</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: #f2f2f2;
}
h1 {
font-size: 36px;
text-align: center;
margin-bottom: 30px;
}
form {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
max-width: 600px;
margin: 0 auto;
}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #4CAF50;
color: #fff;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
padding: 16px;
}
@media screen and (max-width: 600px) {
input[type=submit] {
width: 100%;
}
}
</style>
</head>
<body>
<h1>货代网站</h1>
<form action="/submit" method="post">
<div class="container">
<label for="name">姓名:</label>
<input type="text" id="name" name="name" required>
<label for="email">邮箱:</label>
<input type="text" id="email" name="email" required>
<label for="phone">电话:</label>
<input type="text" id="phone" name="phone" required>
<label for="message">留言:</label>
<textarea id="message" name="message" required></textarea>
<input type="submit" value="提交">
</div>
</form>
</body>
</html>
```
这个网页包含一个简单的表单,用户可以填写姓名、邮箱、电话和留言后提交给服务器。当用户点击提交按钮时,表单数据会被发送到服务器上的 `/submit` 路径。你需要在服务器端编写代码来处理这些表单数据,例如将它们存储到数据库中或发送电子邮件给管理员。