用HTML+CSS+JS写一个的公司网站,类似大型互联网公司的
时间: 2024-01-03 16:16:24 浏览: 26
好的,下面是一个简单的公司网站示例,使用HTML、CSS和JS编写:
HTML:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>公司名</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">产品</a></li>
<li><a href="#">服务</a></li>
<li><a href="#">关于我们</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</nav>
</header>
<section id="banner">
<div class="container">
<h1>欢迎来到公司名</h1>
<p>我们致力于为您提供最优质的服务</p>
<a href="#" class="btn">了解更多</a>
</div>
</section>
<section id="features">
<div class="container">
<h2>我们的产品和服务</h2>
<div class="feature">
<img src="img/product1.jpg" alt="产品1">
<h3>产品1</h3>
<p>产品1的简介</p>
</div>
<div class="feature">
<img src="img/product2.jpg" alt="产品2">
<h3>产品2</h3>
<p>产品2的简介</p>
</div>
<div class="feature">
<img src="img/product3.jpg" alt="产品3">
<h3>产品3</h3>
<p>产品3的简介</p>
</div>
</div>
</section>
<section id="services">
<div class="container">
<h2>我们的服务</h2>
<div class="service">
<i class="fas fa-code"></i>
<h3>开发</h3>
<p>我们提供高质量的软件开发服务</p>
</div>
<div class="service">
<i class="fas fa-cogs"></i>
<h3>维护</h3>
<p>我们提供系统维护服务</p>
</div>
<div class="service">
<i class="fas fa-users"></i>
<h3>培训</h3>
<p>我们提供定制化的培训课程</p>
</div>
</div>
</section>
<section id="about">
<div class="container">
<h2>关于我们</h2>
<p>公司名是一家致力于提供高质量软件开发和系统维护服务的公司。我们拥有一支高素质的技术团队,为客户提供定制化的服务。</p>
</div>
</section>
<section id="contact">
<div class="container">
<h2>联系我们</h2>
<form>
<input type="text" placeholder="姓名">
<input type="email" placeholder="邮箱">
<textarea placeholder="留言"></textarea>
<button type="submit">发送</button>
</form>
</div>
</section>
<footer>
<div class="container">
<p>© 2021 公司名</p>
</div>
</footer>
</body>
</html>
```
CSS:
```css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px;
}
nav {
display: flex;
justify-content: space-between;
}
nav ul {
display: flex;
list-style: none;
}
nav ul li {
margin: 0 10px;
}
nav ul li a {
color: #fff;
text-decoration: none;
}
#banner {
background-image: url('img/banner.jpg');
background-size: cover;
height: 500px;
display: flex;
align-items: center;
justify-content: center;
}
#banner h1 {
font-size: 4em;
text-align: center;
margin-bottom: 20px;
}
#banner p {
font-size: 1.5em;
text-align: center;
margin-bottom: 40px;
}
.btn {
background-color: #333;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
text-decoration: none;
}
.btn:hover {
background-color: #fff;
color: #333;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
#features {
background-color: #f5f5f5;
padding: 80px 0;
}
#features h2 {
font-size: 3em;
text-align: center;
margin-bottom: 40px;
}
.feature {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40px;
}
.feature img {
width: 100%;
max-width: 300px;
margin-bottom: 20px;
}
.feature h3 {
font-size: 1.5em;
text-align: center;
margin-bottom: 10px;
}
.feature p {
text-align: center;
}
#services {
padding: 80px 0;
background-color: #fff;
}
.service {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40px;
}
.service i {
font-size: 3em;
margin-bottom: 20px;
}
.service h3 {
font-size: 1.5em;
text-align: center;
margin-bottom: 10px;
}
.service p {
text-align: center;
}
#about {
background-color: #f5f5f5;
padding: 80px 0;
}
#about h2 {
font-size: 3em;
text-align: center;
margin-bottom: 40px;
}
#about p {
font-size: 1.5em;
text-align: center;
max-width: 800px;
margin: 0 auto;
}
#contact {
padding: 80px 0;
background-color: #fff;
}
#contact h2 {
font-size: 3em;
text-align: center;
margin-bottom: 40px;
}
form {
display: flex;
flex-direction: column;
max-width: 600px;
margin: 0 auto;
}
form input,
form textarea {
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
}
form input {
height: 40px;
}
form textarea {
height: 200px;
}
form button {
background-color: #333;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
border: none;
cursor: pointer;
}
form button:hover {
background-color: #fff;
color: #333;
}
footer {
background-color: #333;
color: #fff;
padding: 10px;
margin-top: 80px;
text-align: center;
}
```
JS:
```javascript
// 可以在此添加 JavaScript 代码
```