CSS3大熊貓卡通效果
分享一段程式碼例項,它實現了卡通效果的大熊貓形象。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼執行程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style> .box { margin: 0 auto; width: 600px; height: 800px; background: #8ECC2B; } .boxC { width: 450px; margin: 0 auto; overflow: hidden; } .box-header { width: 350px; height: 260px; background: #f5f5f5; border-radius: 300px 300px 200px 200px; margin: 0 auto; margin-top: 50px; position: relative; } .header { width: 350px; height: 260px; background: #f5f5f5; border-radius: 300px 300px 200px 200px; top: 0; position: absolute; z-index: 10; } .box-body { width: 350px; height: 250px; margin: 0 auto; background: #f3f3f3; border-radius: 270px 270px 150px 150px; position: relative; } .box-hand { width: 300px; height: 150px; top: -20px; position: relative; margin: 0 auto; border-radius: 150px; overflow: hidden; position: relative; } .bh-a { width: 300px; height: 80px; border-radius: 16px 22px 43px 57px; background: #000; position: absolute; top: 0; } .bh-b { width: 80px; height: 140px; border-radius: 20px 22px 43px 80px; background: #000; position: absolute; left: 0px; } .bh-c { width: 68px; height: 140px; border-radius: 16px 22px 43px 30px; background: #000; position: absolute; right: 0px; } .bh-d { width: 180px; height: 60px; border-radius: 40px 52px 43px 57px; background: #f3f3f3; position: absolute; top: 70px; left: 50%; margin-left: -90px; } .foot { width: 300px; height: 100px; position: relative; margin: 0 auto; } .foot-left { width: 120px; height: 80px; position: absolute; left: 0px; background: #000; border-radius: 90px 100px 20px 80px; bottom: 0; } .foot-right { width: 120px; height: 80px; position: absolute; background: #000; border-radius: 90px 70px 80px 20px; bottom: 0; right: -15px; } .left-ear { position: absolute; top: -25px; width: 120px; height: 80px; left: -20px; background: #000000; -webkit-transform: rotate(-40deg); border-radius: 60px 60px 2px 2px; } .right-ear { position: absolute; top: -25px; width: 120px; height: 80px; right: -20px; background: #000000; -webkit-transform: rotate(40deg); border-radius: 60px 60px 2px 2px; } .left-eyes { position: absolute; left: 80px; width: 60px; height: 80px; background: #000; border-radius: 30px 20px; top: 50px; border-radius: 60px 60px 80px 55px; -webkit-transform: rotate(20deg); } .right-eyes { position: absolute; right: 80px; top: 50px; width: 60px; height: 80px; background: #000; border-radius: 60px 60px 55px 80px; -webkit-transform: rotate(-20deg); } .small-eyes { width: 30px; height: 30px; background: #fff; border-radius: 50%; margin-top: 28px; margin-left: 15px; position: relative; } .small-eyes:after { position: absolute; content: ''; width: 15px; height: 15px; background: #000; border-radius: 50%; top: 8px; left: 0px; -webkit-animation: mymove 2s ease infinite; } @-webkit-keyframes mymove { 0% { left: 0px; } 20% { left: 6px; } 50% { left: 14px; } 80% { left: 6px; } 100% { left: 0px; } } .mask { text-align: center; font-size: 48px; color: #FFF; text-decoration: double; line-height: 200px; } .center-nose { position: absolute; width: 50px; height: 30px; background: #000; border-radius: 50%; left: 50%; margin-left: -25px; top: 118px; } .mouse { width: 80px; height: 50px; position: absolute; top: 156px; margin-left: -40px; left: 50%; border: 6px solid #000000; border-radius: 100%; } .mark { width: 120px; background: #f5f5f5; position: absolute; height: 30px; margin-left: -60px; left: 50%; z-index: 20; top: 156px; } </style> </head> <body> <div class="box"> <div class="boxC"> <div class="box-header"> <div class="header"> <div class="left-eyes"><div class="small-eyes"></div></div> <div class="center-nose"></div> <div class="right-eyes"><div class="small-eyes"></div></div> <div class="mouse"></div> <div class="mark"></div> </div> <div class="left-ear"></div> <div class="right-ear"></div> </div> <div class="box-body"> <div class="box-hand"> <div class="bh-a"></div> <div class="bh-b"></div> <div class="bh-c"></div> <div class="bh-d"></div> </div> <div class="foot"> <div class="foot-left"></div> <div class="foot-right"></div> </div> </div> </div> </div> </body> </html>
相關文章
- canvas卡通形象笑臉效果Canvas
- CSS3卡通形象程式碼例項CSSS3
- canvas繪製卡通人臉形象效果Canvas
- Abstract Pack Mac(彩色卡通元素效果fcpx外掛)Mac
- CSS3旋轉大風車效果詳解CSSS3
- CSS3圓形旋轉變大動畫效果CSSS3動畫
- css3大象行走效果程式碼例項CSSS3
- CSS3象棋效果CSSS3
- CSS3 文字效果CSSS3
- CSS3空心圓效果CSSS3
- CSS3呼吸燈效果CSSS3
- CSS3 矩形切角效果CSSS3
- CSS3哭臉效果CSSS3
- CSS3翻轉效果CSSS3
- Anime Elements And Transitions Mac(卡通動漫元素轉場效果Pr預設)Mac
- CSS3動畫效果下拉導航選單效果CSSS3動畫
- CSS3圓環效果程式碼CSSS3
- CSS3箭靶效果程式碼CSSS3
- CSS3花屏文字效果CSSS3
- CSS3時間軸效果CSSS3
- CSS3白鶴展翅效果CSSS3
- CSS3 checkbox美化效果CSSS3
- CSS3動畫按鈕效果CSSS3動畫
- CSS3 旋轉魔方效果CSSS3
- css3實現翻牌效果CSSS3
- CSS3圓角表格效果CSSS3
- css3的半透明效果CSSS3
- CSS3 Loading效果CSSS3
- 【動畫消消樂|CSS】083.純CSS實現卡通齒輪效果動畫CSS
- css3過渡效果詳解CSSS3
- CSS3圖片旋轉效果CSSS3
- CSS3對勾效果詳解CSSS3
- CSS3圖片拉近放大效果CSSS3
- CSS3載入等待動畫效果CSSS3動畫
- CSS3現菱形效果程式碼CSSS3
- CSS3多面體旋轉效果CSSS3
- CSS3星系旋轉效果代CSSS3
- CSS3多層邊框效果CSSS3