效果
完整代码
HTML部分
<header> <nav> <ul> <li><a href="#home">首页</a></li> <li><a href="#innovations">创新领域</a></li> <li><a href="#projects">项目案例</a></li> <li><a href="#stats">公司数据</a></li> <li><a href="#testimonials">客户反馈</a></li> <li><a href="#contact">联系我们</a></li> </ul> </nav> </header> <section id="home" class="hero"> <div class="hero-content"> <h1>未来科技集团</h1> <p>引领创新,塑造未来</p> <a href="#innovations" class="btn">探索我们的创新</a> </div> </section> <section id="innovations" class="section"> <div class="container"> <div class="section-header"> <h2>创新领域</h2> <p>我们专注于前沿科技,推动各行各业的数字化转型</p> </div> <div class="innovation-grid"> <div class="innovation-item"> <i class="fas fa-brain"></i> <h3>人工智能</h3> <p>开发智能算法,实现自动化决策和预测分析</p> </div> <div class="innovation-item"> <i class="fas fa-vr-cardboard"></i> <h3>增强现实</h3> <p>创造沉浸式体验,revolutionize教育和娱乐行业</p> </div> <div class="innovation-item"> <i class="fas fa-robot"></i> <h3>机器人技术</h3> <p>研发智能机器人,提高工业生产效率</p> </div> <div class="innovation-item"> <i class="fas fa-microchip"></i> <h3>物联网</h3> <p>构建智能设备网络,实现万物互联</p> </div> </div> </div> </section> <section id="stats" class="section stats"> <div class="container"> <div class="stats-grid"> <div class="stat-item"> <h3>200+</h3> <p>成功案例</p> </div> <div class="stat-item"> <h3>50+</h3> <p>行业合作伙伴</p> </div> <div class="stat-item"> <h3>30+</h3> <p>技术专利</p> </div> <div class="stat-item"> <h3>98%</h3> <p>客户满意度</p> </div> </div> </div> </section> <section id="testimonials" class="section testimonials"> <div class="container"> <div class="section-header"> <h2>客户反馈</h2> <p>听听我们客户的心声</p> </div> <div class="testimonial-card"> <img src="./img/1.png" alt="客户头像"> <div> <h3>张总 - 某大型制造企业CEO</h3> <p>"未来科技集团的智能工厂解决方案帮助我们提高了30%的生产效率,真是令人惊叹!"</p> </div> </div> <div class="testimonial-card"> <img src="./img/1.png" alt="客户头像"> <div> <h3>李医生 - 某三甲医院副院长</h3> <p>"他们的AI诊断系统极大地提高了我们的工作效率和诊断准确率,是医疗领域的一大突破。"</p> </div> </div> </div> </section>
CSS部分
:root { --primary-color: #3498db; --secondary-color: #2ecc71; --dark-color: #34495e; --light-color: #ecf0f1; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: var(--dark-color); overflow-x: hidden; } .container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 20px; } header { background-color: var(--dark-color); padding: 1rem 0; position: fixed; width: 100%; top: 0; z-index: 1000; } nav ul { display: flex; justify-content: space-around; list-style: none; } nav ul li a { color: var(--light-color); text-decoration: none; font-weight: bold; transition: color 0.3s ease; } nav ul li a:hover { color: var(--primary-color); } .hero { height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); color: var(--light-color); position: relative; overflow: hidden; } .hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url('./img/012.jpg') no-repeat center center/cover; opacity: 0.2; } .hero-content { position: relative; z-index: 1; } .hero h1 { font-size: 4rem; margin-bottom: 1rem; animation: fadeInUp 1s ease; } .hero p { font-size: 1.5rem; max-width: 600px; margin: 0 auto 2rem; animation: fadeInUp 1s ease 0.5s forwards; opacity: 0; } @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .btn { display: inline-block; background-color: var(--light-color); color: var(--dark-color); padding: 0.8rem 2rem; border-radius: 50px; text-decoration: none; font-weight: bold; transition: all 0.3s ease; } .btn:hover { background-color: var(--dark-color); color: var(--light-color); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); } .section { padding: 1rem 0; } .section-header { text-align: center; margin-bottom: 2rem; } .section-header h2 { font-size: 2.5rem; color: var(--dark-color); margin-bottom: 1rem; } .section-header p { color: #777; max-width: 600px; margin: 0 auto; } .innovation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; } .innovation-item { background-color: #fff; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); padding: 2rem; text-align: center; transition: all 0.3s ease; } .innovation-item:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); } .innovation-item i { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; } .stats { background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); color: var(--light-color); } .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; } .stat-item h3 { font-size: 3rem; margin-bottom: 0.5rem; } .testimonials { background-color: var(--light-color); } .testimonial-card { background-color: #fff; border-radius: 10px; padding:1rem; margin-bottom: 2rem; display: flex; flex-direction: row; align-items: center; box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .testimonial-card img { width: 80px; height: 80px; border-radius: 50%; margin-right: 20px; }