登录  /  注册
首页 > web前端 > H5教程 > 正文

HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果_html5教程技巧

PHP中文网
发布: 2016-05-23 14:20:14
原创
1869人浏览过

使用html5的canvas画的孙悟空,css3画的白云飘飘。

效果图:

<!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;   
top: 0;   
left: 0; 
  
bottombottom: 0;   
rightright: 0;   
}   
div#background { 
  
background: black url(&#39;http://hovertree.com/texiao/html5/30/img/background.png&#39;) 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(&#39;http://hovertree.com/texiao/html5/30/img/midground.png&#39;)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(&#39;http://hovertree.com/texiao/html5/30/img/foreground.png&#39;)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;top: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.com/texiao/html5/30/js/hovertreewk.js"></script> 
  
</body>   
</html>
登录后复制

以上就是HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果_html5教程技巧的内容,更多相关内容请关注PHP中文网(www.php.cn)!

智能AI问答
PHP中文网智能助手能迅速回答你的编程问题,提供实时的代码和解决方案,帮助你解决各种难题。不仅如此,它还能提供编程资源和学习指导,帮助你快速提升编程技能。无论你是初学者还是专业人士,AI智能助手都能成为你的可靠助手,助力你在编程领域取得更大的成就。
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
作者最新文章
最新问题
关于CSS思维导图的课件在哪? 课件
凡人来自于2024-04-16 10:10:18
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号