HOT HTML页面设计
设计思路
使用红色、橙色和黄色的渐变色系传达"热"的感觉
添加火焰动画效果增强视觉冲击
采用现代卡片式布局展示内容
添加悬停效果增加交互性
下面是完整的HTML代码:
<!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HOT - 火热主题页面</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background: linear-gradient(135deg, #1a1a1a, #000000); color: #fff; min-height: 100vh; padding: 20px; } .container { max-width: 1200px; margin: 0 auto; } header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid rgba(255, 69, 0, 0.3); margin-bottom: 40px; } .logo { font-size: 32px; font-weight: 800; background: linear-gradient(45deg, #ff8c00, #ff4500, #ff0000); -webkit-background-clip: text; background-clip: text; color: transparent; display: flex; align-items: center; } .logo i { margin-right: 10px; text-shadow: 0 0 15px #ff4500; animation: pulse 2s infinite; } nav ul { display: flex; list-style: none; } nav li { margin-left: 30px; } nav a { color: #fff; text-decoration: none; font-weight: 500; transition: color 0.3s; position: relative; } nav a:hover { color: #ff4500; } nav a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: linear-gradient(90deg, #ff8c00, #ff4500); transition: width 0.3s; } nav a:hover::after { width: 100%; } .hero { text-align: center; padding: 60px 0; margin-bottom: 50px; } .hero h1 { font-size: 4rem; margin-bottom: 20px; background: linear-gradient(45deg, #ff8c00, #ff4500, #ff0000); -webkit-background-clip: text; background-clip: text; color: transparent; text-transform: uppercase; letter-spacing: 2px; } .hero p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 30px; color: #ccc; line-height: 1.6; } .btn { display: inline-block; padding: 15px 40px; background: linear-gradient(45deg, #ff8c00, #ff4500); color: white; text-decoration: none; border-radius: 30px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; transition: transform 0.3s, box-shadow 0.3s; box-shadow: 0 5px 15px rgba(255, 69, 0, 0.4); } .btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(255, 69, 0, 0.6); } .features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px; } .card { background: rgba(40, 40, 40, 0.8); border-radius: 15px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); } .card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(255, 69, 0, 0.2); } .card-header { padding: 25px; text-align: center; background: linear-gradient(45deg, #ff8c00, #ff4500); } .card-header i { font-size: 40px; } .card-body { padding: 25px; } .card h3 { font-size: 1.5rem; margin-bottom: 15px; color: #ff8c00; } .card p { color: #ccc; line-height: 1.6; } .flame-container { display: flex; justify-content: center; margin: 40px 0; } .flame { width: 100px; height: 100px; position: relative; } .flame-part { position: absolute; border-radius: 50% 0 50% 50%; transform: rotate(45deg); } .flame-1 { width: 50px; height: 50px; background: #ff8c00; box-shadow: 0 0 20px #ff8c00; animation: flicker 1.5s infinite alternate; bottom: 0; left: 25px; } .flame-2 { width: 40px; height: 40px; background: #ff4500; box-shadow: 0 0 15px #ff4500; animation: flicker 1s infinite alternate; bottom: 10px; left: 30px; z-index: 2; } .flame-3 { width: 30px; height: 30px; background: #ff0000; box-shadow: 0 0 10px #ff0000; animation: flicker 0.5s infinite alternate; bottom: 20px; left: 35px; z-index: 3; } footer { text-align: center; padding: 30px 0; margin-top: 40px; border-top: 1px solid rgba(255, 69, 0, 0.3); color: #ccc; } @keyframes flicker { 0% { transform: rotate(45deg) scaleY(1); } 25% { transform: rotate(47deg) scaleY(1.1); } 50% { transform: rotate(43deg) scaleY(0.9); } 75% { transform: rotate(47deg) scaleY(1.2); } 100% { transform: rotate(45deg) scaleY(1); } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } } @media (max-width: 768px) { header { flex-direction: column; text-align: center; } nav ul { margin-top: 20px; justify-content: center; } nav li { margin: 0 10px; } .hero h1 { font-size: 2.5rem; } } </style></head><body> <div class="container"> <header> <div class="logo"> <i class="fas fa-fire"></i> <span>HOT</span> </div> <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 class="hero"> <h1>火热内容 炙手可热</h1> <p>探索最热门、最新鲜、最引人注目的内容和趋势。我们为您呈现当下最火热的资讯、产品和服务。</p> <a href="#" class="btn">立即探索</a> </section> <div class="flame-container"> <div class="flame"> <div class="flame-part flame-1"></div> <div class="flame-part flame-2"></div> <div class="flame-part flame-3"></div> </div> </div> <section class="features"> <div class="card"> <div class="card-header"> <i class="fas fa-chart-line"></i> </div> <div class="card-body"> <h3>热门趋势</h3> <p>实时追踪最新趋势,掌握热门话题动态,让您始终站在潮流前沿。</p> </div> </div> <div class="card"> <div class="card-header"> <i class="fas fa-bolt"></i> </div> <div class="card-body"> <h3>闪电快讯</h3> <p>第一时间获取最新热点资讯,快速了解正在发生的热门事件。</p> </div> </div> <div class="card"> <div class="card-header"> <i class="fas fa-users"></i> </div> <div class="card-body"> <h3>热门社区</h3> <p>加入热门话题讨论,与志同道合的人交流观点,分享见解。</p> </div> </div> </section> <footer> <p>© 2023 HOT主题页面 - 所有权利保留</p> <p>设计:前端开发者 | 灵感源于火与热</p> </footer> </div> <script> // 添加一些简单的交互效果 document.addEventListener('DOMContentLoaded', function() { const cards = document.querySelectorAll('.card'); const btn = document.querySelector('.btn'); cards.forEach((card, index) => { // 添加延迟显示效果 card.style.opacity = 0; card.style.transform = 'translateY(20px)'; setTimeout(() => { card.style.transition = 'opacity 0.5s, transform 0.5s'; card.style.opacity = 1; card.style.transform = 'translateY(0)'; }, 300 + index * 200); }); // 按钮悬浮效果增强 btn.addEventListener('mouseenter', function() { this.style.background = 'linear-gradient(45deg, #ff4500, #ff0000)'; }); btn.addEventListener('mouseleave', function() { this.style.background = 'linear-gradient(45deg, #ff8c00, #ff4500)'; }); }); </script></body></html>
页面特点
响应式设计:页面布局会自适应不同屏幕尺寸
火焰动画:使用CSS创建了逼真的火焰动画效果
渐变色彩:使用红色、橙色和黄色的渐变色系
卡片悬停效果:卡片在鼠标悬停时会浮起并显示阴影效果
现代导航:简洁的导航栏带有悬停效果
您可以直接复制这段代码到HTML文件中,在浏览器中打开即可查看效果。页面中的所有元素都是自包含的,不需要外部资源(除了Font Awesome图标库,它通过CDN加载)。
下一篇 >>
网友留言(0 条)