<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>简洁明快的网站</title> <style> { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; } / 导航栏 / nav { background: #fff; padding: 1rem 5%; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; } nav ul { list-style: none; display: flex; justify-content: center; gap: 2rem; } nav a { text-decoration: none; color: #333; font-weight: 500; transition: color 0.3s; } nav a:hover { color: #4A90E2; } / 头部区域 / header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; text-align: center; padding: 6rem 2rem; } header h1 { font-size: 3rem; margin-bottom: 1rem; } header p { font-size: 1.3rem; opacity: 0.9; } / 内容区域 / .container { max-width: 1200px; margin: 0 auto; padding: 4rem 2rem; } section { margin-bottom: 4rem; } h2 { font-size: 2rem; margin-bottom: 1.5rem; color: #667eea; text-align: center; } / 卡片布局 / .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; } .card { background: #f8f9fa; padding: 2rem; border-radius: 10px; text-align: center; transition: transform 0.3s, box-shadow 0.3s; } .card:hover { transform: translateY(-5px); box-shadow: 0 5px 20px rgba(0,0,0,0.1); } .card h3 { color: #667eea; margin-bottom: 1rem; } / 按钮 / .btn { display: inline-block; background: #667eea; color: white; padding: 0.8rem 2rem; text-decoration: none; border-radius: 5px; margin-top: 1rem; transition: background 0.3s; } .btn:hover { background: #764ba2; } / 页脚 / footer { background: #333; color: white; text-align: center; padding: 2rem; } footer p { opacity: 0.8; } / 响应式设计 / @media (max-width: 768px) { header h1 { font-size: 2rem; } header p { font-size: 1rem; } nav ul { flex-direction: column; gap: 1rem; } } </style> </head> <body> <!-- 导航栏 --> <nav> <ul> <li><a href="#home">首页</a></li> <li><a href="#features">特色</a></li> <li><a href="#about">关于</a></li> <li><a href="#contact">联系</a></li> </ul> </nav> <!-- 头部横幅 --> <header id="home"> <h1>欢迎来到我们的网站</h1> <p>简洁 · 明快 · 现代</p> <a href="#features" class="btn">了解更多</a> </header> <!-- 主要内容 --> <div class="container"> <!-- 特色功能区 --> <section id="features"> <h2>我们的特色</h2> <div class="cards"> <div class="card"> <h3>🚀 快速高效</h3> <p>采用最新技术,确保网站加载速度快,用户体验流畅。</p> </div> <div class="card"> <h3>📱 响应式设计</h3> <p>完美适配各种设备,从手机到电脑都能完美显示。</p> </div> <div class="card"> <h3>🎨 简洁美观</h3> <p>现代化的设计风格,简洁而不失优雅。</p> </div> </div> </section> <!-- 关于我们区 --> <section id="about"> <h2>关于我们</h2> <p style="text-align: center; max-width: 800px; margin: 0 auto; font-size: 1.1rem;"> 我们致力于提供优质的网页设计服务,帮助客户打造专业、现代的在线形象。 我们的团队拥有丰富的经验,能够将您的想法转化为现实。 </p> </section> <!-- 联系我们区 --> <section id="contact"> <h2>联系我们</h2> <div style="text-align: center;"> <p style="margin-bottom: 1rem; font-size: 1.1rem;">有任何问题?随时与我们联系!</p> <a href="mailto:contact@example.com" class="btn">发送邮件</a> </div> </section> </div> <!-- 页脚 --> <footer> <p>&copy; 2024 我们的网站. 保留所有权利.</p> </footer> </body> </html>