HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果
建站知识 2021-07-02 23:00www.168986.cn长沙网站建设
使用HTML5的canvas画的孙悟空,CSS3画的白云飘飘。
效果图
代码如下
CSS Code复制内容到剪贴板
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="description" content="">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>HTML5+CSS3实现齐天大圣腾云驾雾</title>
- <style type="text/css">
- {
- margin: 0;
- padding: 0;
- border: 0;
- }
- html, body {
- margin: 0;
- }
- @-webkit-keyframes STAR-MOVE {
- from {
- background-position: 0% 0%;
- }
- to {
- background-position: 600% 0%;
- }
- }
- @keyframes STAR-MOVE {
- from {
- background-position: 0% 0%;
- }
- to {
- background-position: 600% 0%;
- }
- }
- .wall {
- position: absolute;
- : 0;
- left: 0;
- bottombottom: 0;
- rightright: 0;
- }
- div#background {
- background: black url('http://hovertree./texiao/html5/30/img/background.png') repeat-x 5% 0%;
- background-size: cover;
- -webkit-animation: STAR-MOVE 200s linear infinite;
- -moz-animation: STAR-MOVE 200s linear infinite;
- -ms-animation: STAR-MOVE 200s linear infinite;
- animation: STAR-MOVE 200s linear infinite;
- }
- div#midground {
- background: url('http://hovertree./texiao/html5/30/img/midground.png')repeat 20% 0%;
- z-index: 1;
- -webkit-animation: STAR-MOVE 100s linear infinite;
- -moz-animation: STAR-MOVE 100s linear infinite;
- -ms-animation: STAR-MOVE 100s linear infinite;
- animation: STAR-MOVE 100s linear infinite;
- }
- div#foreground {
- background: url('http://hovertree./texiao/html5/30/img/foreground.png')repeat 35% 0%;
- z-index: 2;
- -webkit-animation: STAR-MOVE 50s linear infinite;
- -moz-animation: STAR-MOVE 50s linear infinite;
- -ms-animation: STAR-MOVE 50s linear infinite;
- animation: STAR-MOVE 50s linear infinite;
- }#hovertreewk{position:absolute;z-index:9999;:0px;bottombottom:0px;left:0px;rightright:0px;margin:auto;}
- </style>
- </head>
- <body>
- <div style="text-align:center;position:absolute;z-index:9;color:white"><h1>齐天大圣腾云驾雾</h1></div>
- <div id="background" class="wall"></div>
- <div id="midground" class="wall"></div>
- <div id="foreground" class="wall"></div>
- <canvas width="650" height="478" id="hovertreewk"></canvas>
- <script src="http://hovertree./texiao/html5/30/js/hovertreewk.js"></script>
- </body>
- </html>
关于HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾的代码就给大家介绍完毕,希望对大家有所帮助!
上一篇:html5需遵循的6个设计原则
下一篇:HTML5标签嵌套规则详解【必看】
长沙网站设计
- 如何进行东阳SEO关键词优化?
- 边坝哪有关键词排名优化:提升你的网站流量与
- 安国百度优化服务:提升您的在线可见性
- 阜康新手做SEO怎么做
- 山西seo网站排名关键词优化:提升您网站曝光率
- 临沂seo网站排名关键词优化:提高你的网站可见
- 广西SEO网站推广怎样付费比较合理
- 双辽SEO网站推广:提升你的网站可见性与流量
- 辽宁企业网站优化购买方式有哪些
- 提升宝清百度SEO排名的实用技巧与策略
- 静宁百度SEO排名:提升您网站曝光率的关键策略
- 彭州百度SEO排名的提升策略和实施指南
- 广南百度关键词SEO:提升网站排名的关键策略
- 辽宁关键词优化怎么做论坛营销
- 吉林百度seo排名如何做到让用户满意
- 内黄百度优化服务:提升在线可见性的关键