免费小型公司首页html+css自适应模板
时间: 2023-09-03 10:05:50 浏览: 135
以下是一个简单的免费小型公司首页 HTML + CSS 自适应模板示例:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Small Company Homepage</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav>
<div class="logo">Small Company</div>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section class="hero">
<h1>Welcome to Small Company</h1>
<p>We provide high-quality services for our clients.</p>
</section>
<section class="about">
<h2>About Us</h2>
<p>We are a small company that specializes in providing top-notch services to our clients. Our team of experts will work closely with you to ensure that all your needs are met and that you are completely satisfied with our work.</p>
</section>
<section class="services">
<h2>Our Services</h2>
<ul>
<li>Service 1</li>
<li>Service 2</li>
<li>Service 3</li>
<li>Service 4</li>
</ul>
</section>
<section class="contact">
<h2>Contact Us</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<label for="message">Message:</label>
<textarea id="message" name="message"></textarea>
<input type="submit" value="Send">
</form>
</section>
</main>
<footer>
<p>© Small Company 2021</p>
</footer>
</body>
</html>
```
以下是对应的 CSS 样式代码:
```css
* {
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
margin: 0;
}
header {
background-color: #333;
color: #fff;
padding: 10px;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
}
nav ul {
display: flex;
list-style: none;
}
nav li {
margin: 0 10px;
}
nav a {
color: #fff;
text-decoration: none;
}
main {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.hero {
background-image: url('hero.jpg');
background-size: cover;
background-position: center;
color: #fff;
text-align: center;
padding: 100px 0;
}
.about {
margin-top: 50px;
}
.services {
margin-top: 50px;
}
.services ul {
list-style: none;
margin: 0;
padding: 0;
}
.services li {
margin: 10px 0;
}
.contact {
margin-top: 50px;
}
.contact form {
display: flex;
flex-direction: column;
}
.contact label,
.contact input,
.contact textarea {
margin: 10px 0;
padding: 5px;
border-radius: 5px;
}
.contact input[type="submit"] {
background-color: #333;
color: #fff;
border: none;
padding: 10px;
cursor: pointer;
}
footer {
background-color: #333;
color: #fff;
padding: 10px;
text-align: center;
}
```
这个模板包括一个响应式导航栏、一个带背景图的主页部分、一个关于我们部分、一个服务部分、一个联系我们表单和一个页脚。可以根据需要自定义并添加更多内容。
阅读全文