html
/ CSS重置 /
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
/ 变量定义 /
root {
primary-color: 2563eb;
secondary-color: 1e40af;
text-color: 1f2937;
light-bg: f3f4f6;
/ 导航栏 /
nav {
background: white;
padding: 1rem 2rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
nav-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
logo {
font-size: 1.5rem;
font-weight: bold;
color: var(primary-color);
nav-links {
display: flex;
gap: 2rem;
nav-links a {
text-decoration: none;
color: var(text-color);
transition: color 0.3s;
nav-links a:hover {
color: var(primary-color);
/ 主内容区 /
main {
margin-top: 80px;
padding: 2rem;
/ 英雄区块 /
hero {
height: 80vh;
background: var(light-bg);
display: flex;
align-items: center;
padding: 0 2rem;
hero-content {
max-width: 1200px;
margin: 0 auto;
hero h1 {
font-size: 3rem;
margin-bottom: 1rem;
color: var(text-color);
hero p {
font-size: 1.2rem;
color: 6b7280;
margin-bottom: 2rem;
cta-button {
background: var(primary-color);
color: white;
padding: 1rem 2rem;
border-radius: 5px;
text-decoration: none;
transition: background 0.3s;
cta-button:hover {
background: var(secondary-color);
/ 卡片布局 /
card-container {
max-width: 1200px;
margin: 4rem auto;
display: flex;
gap: 2rem;
flex-wrap: wrap;
card {
flex: 1;
min-width: 300px;
background: white;
border-radius: 8px;
padding: 2rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
transition: transform 0.3s;
card:hover {
transform: translateY(-5px);
/ 响应式设计 /
@media (max-width: 768px) {
nav-links {
display: none;
hero h1 {
font-size: 2rem;
card {
flex-basis: 100%;
/ 页脚 /
footer {
background: var(text-color);
color: white;
padding: 2rem;
text-align: center;
完美适配各种设备尺寸,从手机到桌面电脑都能完美显示
采用最新的设计趋势,简洁美观的用户界面
优化代码结构,确保最佳性能表现
© 2023 现代网站. All rights reserved.
这个模板包含以下特点:
1. 响应式设计:
2. 现代设计元素:
3. 功能模块:
4. CSS特性:
5. 最佳实践:
使用时可以根据需要:
1. 修改颜色变量(:root中的CSS变量)
2. 替换LOGO文字
3. 修改文字内容
4. 添加更多功能区块
5. 调整间距和字体大小
注意:在实际使用中建议:
添加JavaScript交互功能
版权声明: 知妳网保留所有权利,部分内容为网络收集,如有侵权,请联系QQ793061840删除,添加请注明来意。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态