html网页制作复杂的联系我们
时间: 2023-12-26 21:26:40 浏览: 129
以下是一个简单的HTML联系我们页面的示例,其中包含表单、地图和联系信息:
```html
<!DOCTYPE html>
<html>
<head>
<title>Contact Us</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* 样式表 */
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 0; }
h1 {
text-align: center;
margin-top: 50px;
}
form {
max-width: 600px;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
input[type=text], 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: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
}
.contact-info {
flex-basis: 300px;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
margin-bottom: 20px;
}
.contact-info h2 {
margin-top: 0;
}
.map {
flex-basis: calc(100% - 320px);
height: 400px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<h1>Contact Us</h1>
<form action="#" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" placeholder="Your name.." required>
<label for="email">Email</label>
<input type="text" id="email" name="email" placeholder="Your email.." required>
<label for="message">Message</label>
<textarea id="message" name="message" placeholder="Write something.." style="height:200px" required></textarea>
<input type="submit" value="Submit">
</form>
<div class="container">
<div class="contact-info">
<h2>Contact Information</h2>
<p>123 Main St</p>
<p>Anytown, USA 12345</p>
<p>Phone: 555-555-1234</p>
<p>Email: info@example.com</p>
</div>
<div class="map">
<!-- 在此处插入地图代码 -->
</div>
</div>
</body>
</html>
```
阅读全文