目前只是拿来主义,还没去看H5的语法,日后再补上orz
页面定制一
样式特点:
- 更换页面背景
- 主体背景半透明
- 飘落雪花(装饰物)效果
前戏:
- 将你的图片上传到博客园的相册或者其他图床
- 将以下代码复制到对应的博客园设置框里
页面定制CSS代码一(雪花):
#home h1{ font-size:45px; } body{ background-image: url("https://images.cnblogs.com/likecs_com/yaoxinger/1689144/o_200404014622%E5%B0%81%E9%9D%A21.jpg"); background-position: initial; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-origin: initial; background-clip: initial; <!-- 此处url替换为你的图片地址 --> height:100%; width:100%; } #home{ opacity:0.7; <!-- home(主体)界面的透明度,0.5~0.8最合适 --> } .wall{ position: fixed; top: 0; left: 0; bottom: 0; right: 0; } div#top{ background: url("https://images.cnblogs.com/likecs_com/yaoxinger/1699448/o_200414083518snowflake.png"); z-index: -4; -webkit-animation: da 200s linear infinite; -o-animation: da 200s linear infinite; animation: da 200s linear infinite; } @-webkit-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-o-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-moz-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @keyframes cc { 0%{ background-position: 0 0; } 100%{ background-position: 600% 0; } } @keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-webkit-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-moz-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-ms-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } }
页面定制CSS代码二(星光):
#home h1{ font-size:45px; } body{ background-image: url("https://images.cnblogs.com/likecs_com/yaoxinger/1689144/o_200404014622%E5%B0%81%E9%9D%A21.jpg"); background-position: initial; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-origin: initial; background-clip: initial; <!-- 此处url替换为你的图片地址 --> height:100%; width:100%; } #home{ opacity:0.7; <!-- home(主体)界面的透明度,0.5~0.8最合适 --> } .wall{ position: fixed; top: 0; left: 0; bottom: 0; right: 0; } div#midground{ background: url("https://i.postimg.cc/PP5GtGtM/midground.png"); z-index: -1; -webkit-animation: cc 200s linear infinite; -moz-animation: cc 200s linear infinite; -o-animation: cc 200s linear infinite; animation: cc 200s linear infinite; } div#foreground{ background: url("https://i.postimg.cc/z3jZZD1B/foreground.png"); z-index: -2; -webkit-animation: cc 253s linear infinite; -o-animation: cc 253s linear infinite; -moz-animation: cc 253s linear infinite; animation: cc 253s linear infinite; } div#top{ background: url("https://i.postimg.cc/PP5GtGtM/midground.png"); z-index: -4; -webkit-animation: da 200s linear infinite; -o-animation: da 200s linear infinite; animation: da 200s linear infinite; } @-webkit-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-o-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-moz-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @keyframes cc { 0%{ background-position: 0 0; } 100%{ background-position: 600% 0; } } @keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-webkit-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-moz-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-ms-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } }
页首 HTML 代码:
<div id="midground" class="wall"></div> <div id="foreground" class="wall"></div> <div id="top" class="wall"></div>
页面定制二
样式特点: