CSS3绘画:一个安卓机器人!


你也许在网上看过这样的图片,我也是照着样子画的!


主要是径向渐变,和线性渐变调出高光的效果,其他的没什么难的!


头,身体,四肢,一步步来画!所有的形状都是div的圆角弄出来的,其次注意颜色的细微变化就好了!


效果图.JPG 


我写的比较冗余,大家随便看看吧!


  1. <!DOCTYPE html> 
  2. <html> 
  3. <head> 
  4. <title>纯css打造安卓机器人</title> 
  5. <style type="text/css"> 
  6. body { font-family:"Lucida Sans Unicode"; font-size:14px; color:#4b4b4b; text-align:center; }  
  7. * { padding:0px; margin:0px; }  
  8. #container { position:relative; margin-left:auto; margin-right:auto; margin-top:50px;   
  9. width:700px; height:320px; text-align:left; vertical-align:top; }  
  10. #az,#az_head,#az_body,#az_lhand,#az_rhand,#az_lfoot,#az_rfoot,#az_line,#sword { position:absolute; }  
  11. #az { margin-left:300px; }  
  12. #az:before { content:''; position:absolute; top:350px; left:-270px; width:500px; height:50px; z-index:-10;  
  13. background:rgba(0,0,0,0.7);  
  14. border-radius:200px 200px 200px 200px / 25px 25px 25px 25px;  
  15. box-shadow:0 0 10px 10px rgba(0,0,0,0.5); }  
  16. #az_head { height:110px; width:220px; overflow:hidden; z-index:5;  
  17. border-radius:110px 110px 110px 110px / 100px 100px 10px 10px;  
  18. background:-moz-radial-gradient(74% 32%, ellipse, rgba(159,189,68,1) 0%, rgba(129,169,14,1) 12%, rgba(44,62,0,1) 100%);  
  19. background:-o-radial-gradient(74% 32%, ellipse, rgba(159,189,68,1) 0%, rgba(129,169,14,1) 12%, rgba(44,62,0,1) 100%);  
  20. background:-webkit-gradient(radial, 166 36, 0, 156 36, 160, from(rgba(159,189,68,1)), to(rgba(44,62,0,1)), color-stop(12%, rgba(129,169,14,1)));  
  21. }  
  22. #az_head:before { content:''; position:absolute; width:18px; height:22px; background:#fffa64;  
  23. top:50px; left:30px;  
  24. border-radius:9px / 11px;  
  25. box-shadow:inset 1px 1px 3px #000, 0 0 15px #fffa64;   
  26. transform:rotate(20deg);  
  27. -moz-transform:rotate(20deg);  
  28. -o-transform:rotate(20deg);  
  29. -webkit-transform:rotate(20deg);  
  30. }  
  31. #az_head:after { content:''; position:absolute; width:18px; height:22px; background:#fffa64;  
  32. top:50px; left:136px;  
  33. border-radius:9px / 11px;  
  34. box-shadow:inset 1px 1px 3px #000, 0 0 15px #fffa64;   
  35. transform:rotate(-2deg);  
  36. -moz-transform:rotate(-2deg);  
  37. -o-transform:rotate(-2deg);  
  38. -webkit-transform:rotate(-2deg); }  
  39. #az_body { width:220px; height:200px; background:red; top:103px;  
  40. border-radius:110px 110px 110px 110px / 10px 10px 40px 40px;  
  41. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  42. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  43. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1)); }  
  44. #az_body:before { content:''; position:absolute; width:100%; height:16px; background:#1f3204;  
  45. border-radius:110px 110px 110px 110px / 10px 10px 10px 10px; }  
  46. #az_body:after { content:''; position:absolute; width:100%; height:80px; background:#1f3204; top:120px;  
  47. border-radius:0 0 110px 110px / 0 0 40px 40px;  
  48. background:-moz-linear-gradient(center top, transparent, transparent 50%, rgba(64,82,20,1));  
  49. background:-webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(60%, transparent), to(rgba(64,82,20,1)));  
  50. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(44,62,0,1)); }  
  51. #az_lhand { z-index:-1; width:136px; height:46px; left:-88px; top:148px;  
  52. border-radius:23px;  
  53. transform:rotate(-30deg);  
  54. -moz-transform:rotate(-30deg);  
  55. -o-transform:rotate(-30deg);  
  56. -webkit-transform:rotate(-30deg);  
  57. background:-moz-linear-gradient(top, rgba(44,62,0,1), rgba(109,149,4,1) 55%, rgba(109,149,4,1) 60%, rgba(64,82,20,1));  
  58. background:-webkit-gradient(linear, center top, center bottom, from(rgba(44,62,0,1)), color-stop(55%,rgba(109,149,4,1)), color-stop(60%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  59. background:-o-linear-gradient(top, rgba(44,62,0,1), rgba(109,149,4,1) 55%, rgba(109,149,4,1) 60%, rgba(64,82,20,1)); }  
  60. #az_lhand:before { position:absolute; height:100%; width:50px; content:'';  
  61. border-radius:23px;  
  62. background:-moz-linear-gradient(center left, rgba(44,62,0,1), transparent 50%, transparent);  
  63. background:-webkit-gradient(linear, left center,right center, from(rgba(44,62,0,1)), color-stop(50%, transparent), to(transparent));  
  64. background:-o-linear-gradient(left, rgba(44,62,0,1), transparent 50%, transparent); }  
  65. #az_rhand { width:50px; height:136px; left:188px; top:130px;  
  66. border-radius:25px;  
  67. background:-moz-linear-gradient(left, rgba(70,88,26,1), rgba(139,179,24,1) 70%, rgba(109,149,4,1) 100%);  
  68. background:-webkit-gradient(linear, left center, right center, from(rgba(70,88,26,1)), color-stop(70%,rgba(139,179,24,1)), to(rgba(109,149,4,1)));  
  69. background:-o-linear-gradient(left, rgba(70,88,26,1), rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  70. box-shadow:-10px 6px 12px rgba(0,0,0,0.5); }  
  71. #az_rhand:before { position:absolute; height:46px; width:100%; content:''; top:90px;  
  72. border-radius:50px;  
  73. background:-moz-linear-gradient(top, transparent, transparent 65%, rgba(64,82,20,1));  
  74. background:-webkit-gradient(linear, center top,center bottom, from(transparent), color-stop(65%, transparent), to(rgba(64,82,20,1)));  
  75. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(64,82,20,1)); }  
  76. #az_rfoot { width:50px; height:110px; left:140px; top:270px; z-index:-1;  
  77. border-radius:25px;  
  78. background:-moz-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(109,149,4,1) 100%);  
  79. background:-webkit-gradient(linear, left center, right center, from(rgba(40,58,0,1)), color-stop(70%,rgba(110,150,0,1)), to(rgba(109,149,4,1)));  
  80. background:-o-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(64,82,20,1)); }  
  81. #az_rfoot:before { position:absolute; height:46px; width:100%; content:''; top:64px;  
  82. border-radius:50px;  
  83. background:-moz-linear-gradient(top, transparent, transparent 65%, rgba(64,82,20,1));  
  84. background:-webkit-gradient(linear, center top,center bottom, from(transparent), color-stop(65%, transparent), to(rgba(64,82,20,1)));  
  85. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(64,82,20,1));  
  86. }  
  87. #az_lfoot { width:50px; height:110px; left:30px; top:270px; z-index:-1;  
  88. border-radius:25px;  
  89. background:-moz-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(109,149,4,1) 100%);  
  90. background:-webkit-gradient(linear, left center, right center, from(rgba(40,58,0,1)), color-stop(70%,rgba(110,150,0,1)), to(rgba(109,149,4,1)));  
  91. background:-o-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(64,82,20,1));  
  92. }  
  93. #az_lfoot:before { position:absolute; height:46px; width:100%; content:''; top:64px;  
  94. border-radius:50px;  
  95. background:-moz-linear-gradient(top, transparent, transparent 65%, rgba(64,82,20,1));  
  96. background:-webkit-gradient(linear, center top,center bottom, from(transparent), color-stop(65%, transparent), to(rgba(64,82,20,1)));  
  97. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(64,82,20,1));  
  98. }  
  99. #az_line { width:6px; height:50px; left:170px; z-index:5; top:-20px;  
  100. border-radius:5px;  
  101. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  102. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  103. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  104. transform:rotate(30deg);  
  105. -moz-transform:rotate(30deg);  
  106. -o-transform:rotate(30deg);  
  107. -webkit-transform:rotate(30deg);  
  108. }  
  109. #az_line:before { content:''; width:100%; height:5px; z-index:6; background:rgba(0,0,0,0.2); top:50px;  
  110. box-shadow:-1px -2px 2px 2px rgba(0,0,0,0.5); position:absolute; border-radius:5px;  
  111. }  
  112. #az_line:after { content:''; width:6px; height:40px; z-index:-15; top:73px; position:absolute; left:-120px;  
  113. border-radius:5px;  
  114. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  115. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  116. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  117. transform:rotate(-60deg);  
  118. -moz-transform:rotate(-60deg);  
  119. -o-transform:rotate(-60deg);  
  120. -webkit-transform:rotate(-60deg);  
  121. }  
  122. #sword { width:6px; height:220px; top:-5px; left:-130px;  
  123. box-shadow:0 -10px 8px 5px red;  
  124. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  125. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  126. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  127. transform:rotate(-32deg);  
  128. -moz-transform:rotate(-32deg);  
  129. -o-transform:rotate(-32deg);  
  130. -webkit-transform:rotate(-32deg);  
  131. -moz-animation:light 3s linear infinite backwards;  
  132. -webkit-animation:light 3s linear infinite backwards;  
  133. }  
  134. @-moz-keyframes light {   
  135. 50% { box-shadow:0 -10px 8px 5px skyblue; }   
  136. }  
  137. @-webkit-keyframes light {   
  138. 50% { box-shadow:0 -10px 2px 2px skyblue; }   
  139. }  
  140. </style> 
  141. </head> 
  142. <body> 
  143. <div id="container"> 
  144. <div id="az"> 
  145.   <div id="az_head"></div> 
  146.   <div id="az_body"></div> 
  147.   <div id="az_lhand"></div> 
  148.   <div id="az_rhand"></div> 
  149.   <div id="az_lfoot"></div> 
  150.   <div id="az_rfoot"></div> 
  151.   <div id="az_line"></div> 
  152.   <div id="sword"></div> 
  153. </div> 
  154. </div> 
  155. </body> 
  156. </html> 



标签:

友情链接
轻松育儿世界奇观
苏ICP备16066217号-2