效果
完整代码
HTML部分
<div class="container"> <header class="header"> <div class="logo">某某某公司</div> <nav class="nav-menu"> <a href="#" class="nav-item">项目资料</a> <a href="#" class="nav-item">商业资讯</a> <a href="#" class="nav-item">专家顾问</a> <a href="#" class="nav-item">服务介绍</a> <a href="#" class="nav-item">联系我们</a> </nav> </header> <div class="main-content"> <section class="hero"> <div class="hero-content"> <h1>您专属的融资中心</h1> <p>一站式融资解决方案,精准政府、银行、资本市场三大资源渠道</p> <div class="cta-buttons"> <a href="#" class="cta-button">产品服务手册</a> <a href="#" class="cta-button">免费咨询</a> </div> </div> </section> <section class="login-section"> <form class="login-form"> <input type="text" placeholder="手机号/用户名"> <input type="password" placeholder="密码"> <button class="login-button">登 录</button> </form> <div class="social-login"> <a href="#">社交账号登录</a> <a href="#">忘记密码?</a> </div> </section> </div> <div class="stats"> <div class="stat-item"> <div class="stat-number">2,903亿</div> <div class="stat-label">融资金额</div> </div> <div class="stat-item"> <div class="stat-number">230+</div> <div class="stat-label">合作企业</div> </div> <div class="stat-item"> <div class="stat-number">1,000+</div> <div class="stat-label">成功项目</div> </div> </div> <div class="icons"> <div class="icon-item"> <div class="icon-circle"> <img src="./img/0901.png" alt="扶持补贴"> </div> <div class="icon-label">扶持补贴</div> </div> <div class="icon-item"> <div class="icon-circle"> <img src="./img/0901.png" alt="专项资金"> </div> <div class="icon-label">专项资金</div> </div> <div class="icon-item"> <div class="icon-circle"> <img src="./img/0901.png" alt="政府资金"> </div> <div class="icon-label">政府资金</div> </div> </div> </div>
CSS部分
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } body, html { margin: 0; padding: 0; font-family: Arial, sans-serif; height: 100%; } .container { display: flex; flex-direction: column; height: 100%; } .header { background-color: white; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e0e0e0; animation: fadeIn 0.5s ease-out; } .logo { color: #ff6600; font-size: 24px; font-weight: bold; } .nav-menu { display: flex; } .nav-item { margin-left: 20px; color: #333; text-decoration: none; transition: color 0.3s ease; } .nav-item:hover { color: #ff6600; } .user-actions { display: flex; align-items: center; } .user-actions a { margin-left: 20px; color: #333; text-decoration: none; transition: color 0.3s ease; } .user-actions a:hover { color: #ff6600; } .main-content { flex: 1; display: flex; background-image: url('./img/012.jpg'); background-size: cover; background-position: center; } .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-left: 50px; color: white; } .hero-content { animation: slideIn 0.8s ease-out; } .hero-content h1 { font-size: 36px; margin-bottom: 10px; } .hero-content p { font-size: 18px; margin-bottom: 20px; max-width: 600px; } .cta-buttons { display: flex; margin-bottom: 40px; } .cta-button { background-color: #ff6600; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; margin-right: 10px; transition: background-color 0.3s ease; } .cta-button:hover { background-color: #e55b00; } .login-section { width: 300px; background-color: rgba(255, 255, 255, 0.9); padding: 20px; align-self: center; margin-right: 50px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); animation: fadeIn 1s ease-out 0.5s both; } .login-form input { display: block; margin-bottom: 15px; padding: 10px; width: 100%; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; } .login-button { background-color: #ff6600; color: white; border: none; padding: 12px; width: 100%; cursor: pointer; border-radius: 4px; transition: background-color 0.3s ease; } .login-button:hover { background-color: #e55b00; } .social-login { display: flex; justify-content: space-between; margin-top: 15px; } .social-login a { color: #666; text-decoration: none; font-size: 14px; transition: color 0.3s ease; } .social-login a:hover { color: #ff6600; } .stats { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; width: 1200px; margin: 0 auto; margin-top:-20px; background-color: #fff; padding: 25px 20px; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .stat-item { text-align: center; } .stat-number { font-size: 24px; font-weight: bold; color: #ff6600; } .stat-label { font-size: 14px; color: #666; } .icons { display: flex;margin-top: 60px;; justify-content: space-around; text-align: center; padding-bottom: 40px; } .icon-item { width: 100px; } .icon-circle { width: 80px; height: 80px; border-radius: 50%; border: 2px solid #ccc; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; } .icon-circle img { width: 40px; height: 40px; } .icon-label { font-size: 14px; color: #333; } /* 新增的关键帧动画 */ @keyframes fadeInIcon { from { opacity: 0; } to { opacity: 1; } } /* 修改 .icon-item 的样式 */ .icon-item { width: 100px; animation: fadeInIcon 0.5s ease-in-out; } /* 为每个 .icon-item 设置不同的延迟时间 */ .icon-item:nth-child(1) { animation-delay: 0.1s; } .icon-item:nth-child(2) { animation-delay: 0.3s; } .icon-item:nth-child(3) { animation-delay: 0.5s; }