本篇內(nèi)容主要講解“怎么用HTML5+Canvas+CSS3實(shí)現(xiàn)齊天大圣孫悟空騰云駕霧效果”,感興趣的朋友不妨來看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“怎么用HTML5+Canvas+CSS3實(shí)現(xiàn)齊天大圣孫悟空騰云駕霧效果”吧!
成都創(chuàng)新互聯(lián)專注于城西企業(yè)網(wǎng)站建設(shè),自適應(yīng)網(wǎng)站建設(shè),成都商城網(wǎng)站開發(fā)。城西網(wǎng)站建設(shè)公司,為城西等地區(qū)提供建站服務(wù)。全流程按需求定制制作,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)
使用HTML5的canvas畫的孫悟空,CSS3畫的白云飄飄。
效果圖:
代碼如下:
CSS Code復(fù)制內(nèi)容到剪貼板
<!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實(shí)現(xiàn)齊天大圣騰云駕霧</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('http://hovertree.com/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.com/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.com/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;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"><h2>齊天大圣騰云駕霧</h2></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>
到此,相信大家對(duì)“怎么用HTML5+Canvas+CSS3實(shí)現(xiàn)齊天大圣孫悟空騰云駕霧效果”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
網(wǎng)頁題目:怎么用HTML5+Canvas+CSS3實(shí)現(xiàn)齊天大圣孫悟空騰云駕霧效果
文章分享:http://aaarwkj.com/article28/jegcjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、域名注冊(cè)、網(wǎng)站營(yíng)銷、移動(dòng)網(wǎng)站建設(shè)、服務(wù)器托管、全網(wǎng)營(yíng)銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)