news 2026/4/11 19:21:38

新年页面定制CSS

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
新年页面定制CSS

效果:

新年页面定制CSS:

@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap'); /* 新年祝福横幅 */ #cnblogs_post_body::before, .day::before { content: "⌨️ 码上发财🖱️"; display: block; position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #ff0000, #ff6b6b); color: gold; padding: 0.8rem 2rem; border-radius: 50px; font-family: 'Ma Shan Zheng', cursive; font-size: 1.2rem; font-weight: bold; z-index: 9999; box-shadow: 0 4px 20px rgba(255, 0, 0, 0.5); animation: banner-glow 2s ease-in-out infinite; border: 2px solid gold; pointer-events: none; } @keyframes banner-glow { 0%, 100% { box-shadow: 0 4px 20px rgba(255, 0, 0, 0.5); } 50% { box-shadow: 0 4px 30px rgba(255, 215, 0, 0.8); } } /* 左侧对联 */ body::before { content: "烦恼一骑绝尘去"; white-space: pre; position: fixed; left: 3%; top: 50%; transform: translateY(-50%); background: linear-gradient(180deg, #ff0000, #cc0000); color: gold; padding: 2rem 0.8rem; border-radius: 8px; font-family: 'Ma Shan Zheng', cursive; font-size: 1.5rem; font-weight: bold; line-height: 2.5rem; text-align: center; writing-mode: vertical-rl; letter-spacing: 0.3rem; z-index: 9997; border: 3px solid gold; box-shadow: 0 4px 20px rgba(255, 0, 0, 0.6); pointer-events: none; } /* 右侧对联 */ #sideBar::before { content: "钞票万马奔腾来"; white-space: pre; position: fixed; right: 3%; top: 50%; transform: translateY(-50%); background: linear-gradient(180deg, #ff0000, #cc0000); color: gold; padding: 2rem 0.8rem; border-radius: 8px; font-family: 'Ma Shan Zheng', cursive; font-size: 1.5rem; font-weight: bold; line-height: 2.5rem; text-align: center; writing-mode: vertical-rl; letter-spacing: 0.3rem; z-index: 9997; border: 3px solid gold; box-shadow: 0 4px 20px rgba(255, 0, 0, 0.6); pointer-events: none; } /* 灯笼装饰 - 左上 */ #header::before { content: "🏮"; position: fixed; top: 90px; left: 8%; font-size: 2.5rem; animation: lantern-swing 3s ease-in-out infinite; filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.5)); z-index: 9997; pointer-events: none; } /* 灯笼装饰 - 右上 */ #header::after { content: "🏮"; position: fixed; top: 90px; right: 8%; font-size: 2.5rem; animation: lantern-swing 3s ease-in-out infinite 0.5s; filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.5)); z-index: 9997; pointer-events: none; } @keyframes lantern-swing { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } } /* 红包装饰 - 左中 */ .postTitle::before { content: "🧧"; position: fixed; top: 180px; left: 15%; font-size: 2rem; animation: hongbao-swing 4s ease-in-out infinite 0.3s; filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)); z-index: 9996; pointer-events: none; } /* 红包装饰 - 右中 */ .postTitle::after { content: "🧧"; position: fixed; top: 180px; right: 15%; font-size: 2rem; animation: hongbao-swing 4s ease-in-out infinite 0.8s; filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)); z-index: 9996; pointer-events: none; } @keyframes hongbao-swing { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-20px) rotate(5deg); } } /* 金色粒子效果 - 左上角 */ #navList::before { content: ""; position: fixed; width: 8px; height: 8px; background: gold; border-radius: 50%; top: 130px; left: 20%; animation: gold-twinkle 2s ease-in-out infinite; box-shadow: 0 0 10px gold; z-index: 9995; pointer-events: none; } /* 金色粒子效果 - 右上角 */ #navList::after { content: ""; position: fixed; width: 8px; height: 8px; background: gold; border-radius: 50%; top: 130px; right: 20%; animation: gold-twinkle 2s ease-in-out infinite 0.5s; box-shadow: 0 0 10px gold; z-index: 9995; pointer-events: none; } @keyframes gold-twinkle { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } } /* 烟花粒子容器 - 使用博客园现有元素 */ #blogTitle::after { content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9990; background-image: radial-gradient(circle, #ff0000 2px, transparent 2px), radial-gradient(circle, #ffd700 2px, transparent 2px), radial-gradient(circle, #ff6b6b 2px, transparent 2px), radial-gradient(circle, #ffa500 2px, transparent 2px); background-size: 200px 200px, 300px 300px, 250px 250px, 350px 350px; background-position: 0 0, 50px 50px, 100px 100px, 150px 150px; animation: firework-fall 15s linear infinite; opacity: 0.6; } @keyframes firework-fall { 0% { background-position: 0 -100px, 50px -50px, 100px -150px, 150px -200px; } 100% { background-position: 0 100vh, 50px calc(100vh + 50px), 100px calc(100vh + 100px), 150px calc(100vh + 150px); } } /* 页面顶部留出空间给新年横幅 */ #home { margin-top: 80px !important; } /* 让装饰不影响文字选择 */ body::before, #cnblogs_post_body::before, .day::before, #header::before, #header::after, #blogTitle::after, #sideBar::before, .postTitle::before, .postTitle::after, #navList::before, #navList::after { user-select: none; -webkit-user-select: none; -moz-user-select: none; } /* 响应式设计 - 手机端优化 */ @media (max-width: 768px) { #cnblogs_post_body::before, .day::before { font-size: 0.9rem; padding: 0.5rem 1rem; } #header::before, #header::after { font-size: 1.8rem; top: 70px; } .postTitle::before, .postTitle::after { font-size: 1.5rem; } #blogTitle::before, #sideBar::before { font-size: 1.2rem; padding: 1.5rem 0.6rem; } }
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/1 21:35:21

ArcGIS Pro 从入门到实战基础篇(22):新建笔记本

在 ArcGIS Pro 中,除了通过界面操作完成 GIS 分析,还可以使用代码进行自动化处理和数据分析。 笔记本提供了一种将代码、说明文字和运行结果集中在一起的方式,是连接 GIS 操作与脚本分析的重要工具。 什么是 ArcGIS Pro 中的笔记本 通俗的…

作者头像 李华
网站建设 2026/4/10 17:19:34

软件测试的基本流程

🍅 点击文末小卡片,免费获取软件测试全套资料,资料在手,涨薪更快 软件测试和软件开发一样,是一个比较复杂的工作过程,如果无章法可循,随意进行测试势必会造成测试工作的混乱。为了使测试工作标准…

作者头像 李华
网站建设 2026/4/4 3:38:21

什么是网络爬虫?有什么用?怎么爬?终于有人讲明白了

【导读】网络爬虫也叫做网络机器人,可以代替人们自动地在互联网中进行数据信息的采集与整理。在大数据时代,信息的采集是一项重要的工作,如果单纯靠人力进行信息采集,不仅低效繁琐,搜集的成本也会提高。 此时&#xf…

作者头像 李华
网站建设 2026/4/10 17:19:32

物联网平台赋能可视化数据与决策,打造工厂“智慧大脑”

在数字化转型浪潮中,数据已成为企业的新型生产要素。然而,对于许多企业管理者而言,面临的核心挑战不是数据匮乏,而是数据“看不见、看不懂、用不上”。海量的设备数据、生产数据、能耗数据分散在各个系统中,无法形成全…

作者头像 李华
网站建设 2026/4/4 11:51:19

书籍-亨利·裕尔《东域纪程录丛》

亨利裕尔《东域纪程录丛》详细介绍 书籍基本信息 书名:东域纪程录丛(Cathay and the Way Thither,又译《古代中国闻见录》《契丹与通往契丹之路》) 作者:亨利裕尔(Henry Yule,1820-1889&#xf…

作者头像 李华