HTML5+CSS3实现机器猫


Posted in HTML / CSS onOctober 17, 2016

下面一段代码是有关html5和css3实现机器猫的代码,具体代码如下所示:

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPE html>  
  2. <html lang="en">  
  3. <head>  
  4. <meta charset="UTF-8">  
  5. <title>机器猫</title>  
  6. <style type="text/css">  
  7. * {   
  8. margin: 0;   
  9. padding: 0;   
  10. }   
  11. .whole {   
  12. width: 800px;   
  13. margin: 20px auto;   
  14. /*border: 2px solid yellow;*/   
  15. background-color: white;   
  16. position: relative;   
  17. }   
  18. .head {   
  19. margin: 0 auto;   
  20. position: relative;   
  21. width: 500px;   
  22. height: 440px;   
  23. background-color: #00b7e7;   
  24. border-radius: 220px;   
  25. border: 1px solid red;   
  26. }   
  27. .eye .left_eye,   
  28. .eye .right_eye {   
  29. width: 100px;   
  30. height: 130px;   
  31. background-color: white;   
  32. border: 2px solid black;   
  33. border-radius: 50px;   
  34. position: absolute;   
  35. top: 50px;   
  36. z-index: 3;   
  37. }   
  38. .eye .LeyeBall,   
  39. .eye .ReyeBall {   
  40. width: 20px;   
  41. height: 20px;   
  42. background: black;   
  43. border-radius: 10px;   
  44. position: absolute;   
  45. top: 65px;   
  46. }   
  47. .eye .left_eye {   
  48. left: 146px;   
  49. }   
  50. .eye .right_eye {   
  51. left: 250px;   
  52. }   
  53. .eye .LeyeBall {   
  54. right: 10px;   
  55. }   
  56. .eye .ReyeBall {   
  57. left: 10px;   
  58. }   
  59. .face {   
  60. position: relative;   
  61. z-index: 2;   
  62. }   
  63. .face .feature {   
  64. width: 400px;   
  65. height: 320px;   
  66. border-radius: 160px;   
  67. position: absolute;   
  68. top: 100px;   
  69. left: 50px;   
  70. background: white;   
  71. }   
  72. .face .nose {   
  73. width: 45px;   
  74. height: 50px;   
  75. border-radius: 23px;   
  76. background-color: #cf3318;   
  77. border: 2px solid black;   
  78. position: absolute;   
  79. top: 165px;   
  80. left: 225px;   
  81. z-index: 3;   
  82. }   
  83. .face .Nline {   
  84. width: 3px;   
  85. height: 160px;   
  86. background: black;   
  87. position: absolute;   
  88. top: 218px;   
  89. left: 248px;   
  90. z-index: 3;   
  91. }   
  92. .face .mouth {   
  93. width: 280px;   
  94. height: 280px;   
  95. border-bottom: 5px solid black;   
  96. border-radius: 140px;   
  97. position: absolute;   
  98. top: 98px;   
  99. left: 105px;   
  100. }   
  101. .face .mustache .MutR_higher {   
  102. width: 80px;   
  103. height: 2px;   
  104. background: black;   
  105. position: absolute;   
  106. top: 220px;   
  107. left: 295px;   
  108. z-index: 2;   
  109. }   
  110. .face .mustache .MutR_middle {   
  111. width: 80px;   
  112. height: 2px;   
  113. background: black;   
  114. position: absolute;   
  115. top: 240px;   
  116. left: 295px;   
  117. z-index: 2;   
  118. }   
  119. .face .mustache .MutR_lower {   
  120. width: 80px;   
  121. height: 2px;   
  122. background: black;   
  123. position: absolute;   
  124. top: 260px;   
  125. left: 295px;   
  126. z-index: 2;   
  127. }   
  128. .face .mustache .MutL_top {   
  129. width: 80px;   
  130. height: 2px;   
  131. background: black;   
  132. position: absolute;   
  133. top: 220px;   
  134. left: 115px;   
  135. z-index: 2;   
  136. }   
  137. .face .mustache .MutL_center {   
  138. width: 80px;   
  139. height: 2px;   
  140. background: black;   
  141. position: absolute;   
  142. top: 240px;   
  143. left: 115px;   
  144. z-index: 2;   
  145. }   
  146. .face .mustache .MutL_bottom {   
  147. width: 80px;   
  148. height: 2px;   
  149. background: black;   
  150. position: absolute;   
  151. top: 260px;   
  152. left: 115px;   
  153. z-index: 2;   
  154. }   
  155. .face .mustache .MutL_bottom,   
  156. .face .mustache .MutR_higher {   
  157. transform: rotate(160deg);   
  158. }   
  159. .face .mustache .MutL_top,   
  160. .face .mustache .MutR_lower {   
  161. transform: rotate(200deg);   
  162. }   
  163. .neck {   
  164. width: 300px;   
  165. height: 30px;   
  166. background-color: #a31f12;   
  167. border: 2px solid black;   
  168. border-radius: 15px;   
  169. position: relative;   
  170. top: 0px;   
  171. left: 250px;   
  172. z-index: 4;   
  173. }   
  174. .neck .bell {   
  175. width: 60px;   
  176. height: 60px;   
  177. overflow: hidden;   
  178. border: 2px solid black;   
  179. border-radius: 60px;   
  180. background-color: #cfcb3c;   
  181. position: absolute;   
  182. top: 5px;   
  183. left: 120px;   
  184. }   
  185. .bell .Bline {   
  186. width: 60px;   
  187. height: 2px;   
  188. background-color: #cfcb3c;   
  189. border: 2px solid black;   
  190. border-radius: 3px 3px 0 0;   
  191. position: absolute;   
  192. top: 15px;   
  193. }   
  194. .bell .Bcircle {   
  195. width: 20px;   
  196. height: 16px;   
  197. background: black;   
  198. border-radius: 8px;   
  199. position: absolute;   
  200. top: 25px;   
  201. left: 20px;   
  202. }   
  203. .bell .Bunderpart {   
  204. width: 3px;   
  205. height: 20px;   
  206. background-color: black;   
  207. position: absolute;   
  208. left: 28px;   
  209. top: 40px;   
  210. }   
  211. .body {   
  212. position: relative;   
  213. top: -300px;   
  214. z-index: 1;   
  215. }   
  216. .body .tummy {   
  217. width: 280px;   
  218. height: 240px;   
  219. background-color: #00b1e1;   
  220. border: 2px solid black;   
  221. position: absolute;   
  222. top: 267px;   
  223. left: 260px;   
  224. }   
  225. .body .bellyband {   
  226. width: 220px;   
  227. height: 220px;   
  228. background-color: white;   
  229. border: 2px solid black;   
  230. border-radius: 110px;   
  231. position: absolute;   
  232. left: 290px;   
  233. top: 267px;   
  234. }   
  235. .body .pocket {   
  236. width: 160px;   
  237. height: 160px;   
  238. border-radius: 80px;   
  239. background-color: white;   
  240. border: 2px solid black;   
  241. position: absolute;   
  242. top: 305px;   
  243. left: 320px;   
  244. }   
  245. .cover {   
  246. width: 164px;   
  247. height: 80px;   
  248. background-color: white;   
  249. border-bottom: 2px solid black;   
  250. /*border: 5px solid orange;*/   
  251. position: absolute;   
  252. top: 300px;   
  253. left: 320px;   
  254. }   
  255. .left_hand,   
  256. .right_hand {   
  257. height: 100px;   
  258. width: 100px;   
  259. position: absolute;   
  260. top: 272px;   
  261. left: 248px;   
  262. }   
  263. .left_hand {   
  264. left: -10px;   
  265. }   
  266. .left_hand .Larm {   
  267. width: 70px;   
  268. height: 100px;   
  269. background-color: #00bee8;   
  270. border: 1px solid black;   
  271. position: relative;   
  272. top: 200px;   
  273. left: 535px;   
  274. transform: rotateZ(135deg);   
  275. /*z-index: -1;*/   
  276. }   
  277. .right_hand {   
  278. left: -10px;   
  279. }   
  280. .right_hand .Rarm {   
  281. width: 70px;   
  282. height: 100px;   
  283. background-color: #00bee8;   
  284. border: 1px solid black;   
  285. /*z-index: -1;*/   
  286. position: relative;   
  287. top: 200px;   
  288. left: 215px;   
  289. transform: rotateZ(45deg);   
  290. }   
  291. .left_hand .Lpalm,   
  292. .right_hand .Rpalm {   
  293. width: 80px;   
  294. height: 80px;   
  295. border-radius: 40px;   
  296. border: 2px solid black;   
  297. background-color: white;   
  298. position: absolute;   
  299. }   
  300. .right_hand .Rpalm {   
  301. left: 580px;   
  302. top: 260px;   
  303. z-index: 1;   
  304. }   
  305. .left_hand .Lpalm {   
  306. left: 160px;   
  307. top: 260px;   
  308. z-index: 1;   
  309. }   
  310. .foot .left_foot,   
  311. .foot .right_foot {   
  312. width: 150px;   
  313. height: 40px;   
  314. background-color: white;   
  315. border: 2px solid black;   
  316. border-radius: 80px 60px 60px 40px;   
  317. position: relative;   
  318. }   
  319. .foot .left_foot {   
  320. left: 240px;   
  321. top: 210px;   
  322. }   
  323. .foot .right_foot {   
  324. top: 165px;   
  325. left: 410px;   
  326. }   
  327. .foot .crotch {   
  328. width: 40px;   
  329. height: 20px;   
  330. background-color: white;   
  331. border: 2px solid black;   
  332. border-bottom: none;   
  333. border-radius: 40px 40px 0 0;   
  334. position: relative;   
  335. top: 103px;   
  336. left: 382px;   
  337. z-index: 2   
  338. }   
  339. </style>  
  340. </head>  
  341. <body>  
  342. <div class="wrap">  
  343. <div class="whole">  
  344. <!-- 头 -->  
  345. <div class="head">  
  346. <!-- 眼 -->  
  347. <div class="eye">  
  348. <!-- 左眼 -->  
  349. <div class="left_eye">  
  350. <!-- 左眼球 -->  
  351. <div class="LeyeBall"></div>  
  352. </div>  
  353. <!-- 右眼 -->  
  354. <div class="right_eye">  
  355. <!-- 右眼球 -->  
  356. <div class="ReyeBall"></div>  
  357. </div>  
  358. </div>  
  359. <!-- 脸 -->  
  360. <div class="face">  
  361. <!-- 脸型 -->  
  362. <div class="feature"></div>  
  363. <!-- 鼻 -->  
  364. <div class="nose"></div>  
  365. <!-- 鼻子线 -->  
  366. <div class="Nline"></div>  
  367. <!-- 嘴 -->  
  368. <div class="mouth"></div>  
  369. <!-- 胡子 -->  
  370. <div class="mustache">  
  371. <div class="MutL_top"></div>  
  372. <div class="MutL_center"></div>  
  373. <div class="MutL_bottom"></div>  
  374. <div class="MutR_higher"></div>  
  375. <div class="MutR_middle"></div>  
  376. <div class="MutR_lower"></div>  
  377. </div>  
  378. </div>  
  379. </div>  
  380. <!-- 脖子 -->  
  381. <div class="neck">  
  382. <!-- 铃铛 -->  
  383. <div class="bell">  
  384. <div class="Bline"></div>  
  385. <div class="Bcircle"></div>  
  386. <div class="Bunderpart"></div>  
  387. </div>  
  388. </div>  
  389. <!-- 身体 -->  
  390. <div class="body">  
  391. <!-- 肚子 -->  
  392. <div class="tummy"></div>  
  393. <!-- 肚兜 -->  
  394. <div class="bellyband"></div>  
  395. <!-- 口袋 -->  
  396. <div class="pocket"></div>  
  397. <div class="cover"></div>  
  398. </div>  
  399. <!-- 左手 -->  
  400. <div class="left_hand">  
  401. <!-- 手臂 -->  
  402. <div class="Larm"></div>  
  403. <!-- 手掌 -->  
  404. <div class="Lpalm"></div>  
  405. </div>  
  406. <!-- 右手 -->  
  407. <div class="right_hand">  
  408. <!-- 手臂 -->  
  409. <div class="Rarm"></div>  
  410. <!-- 手掌 -->  
  411. <div class="Rpalm"></div>  
  412. </div>  
  413. <!-- 脚 -->  
  414. <div class="foot">  
  415. <!-- 左脚 -->  
  416. <div class="left_foot"></div>  
  417. <!-- 右脚 -->  
  418. <div class="right_foot"></div>  
  419. <div class="crotch"></div>  
  420. </div>  
  421. </div>  
  422. </div>  
  423. </body>  
  424. </html>  

以上所述是小编给大家介绍的HTML5+CSS3实现机器猫,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对三水点靠木网站的支持!

HTML / CSS 相关文章推荐
CSS3样式linear-gradient的使用实例
Jan 16 HTML / CSS
利用纯CSS3实现tab选项卡切换示例代码
Sep 21 HTML / CSS
CSS3制作3D立方体loading特效
Nov 09 HTML / CSS
CSS3+HTML5+JS 实现一个块的收缩与展开动画效果
Nov 17 HTML / CSS
利用HTML5+css3+jquery+weui实现仿微信聊天界面功能
Jan 08 HTML / CSS
HTML5 Canvas——用路径描画线条实例介绍
Jun 09 HTML / CSS
HTML5实现桌面通知 提示功能
Oct 11 HTML / CSS
HTML5 常见面试题之PC端和移动端区别介绍
Jan 22 HTML / CSS
ivx平台开发之不用代码实现一个九宫格抽奖功能
Jan 27 HTML / CSS
奇妙的 CSS shapes(CSS图形)
Apr 05 HTML / CSS
CSS3 实现的图片悬停的切换按钮
Apr 13 HTML / CSS
css让页脚保持在底部位置的四种方案
Jul 23 HTML / CSS
html5将图片转换成base64的实例代码
Sep 21 #HTML / CSS
CSS3 画基本图形,圆形、椭圆形、三角形等
Sep 20 #HTML / CSS
html5本地存储 localStorage操作使用详解
Sep 20 #HTML / CSS
使用Html5实现异步上传文件,支持跨域,带有上传进度条
Sep 17 #HTML / CSS
a标签下载链接的简单实现
Sep 13 #HTML / CSS
HTML5新增加的功能详解
Sep 05 #HTML / CSS
HTML5新增加标签和功能概述
Sep 05 #HTML / CSS
You might like
再次研究下cache_lite
2007/02/14 PHP
PHP 数组和字符串互相转换实现方法
2013/03/26 PHP
微信支付PHP SDK ―― 公众号支付代码详解
2016/09/13 PHP
phpcms的分类名称和类别名称的调用
2017/01/05 PHP
js option删除代码集合
2008/11/12 Javascript
Javascript Tab 导航插件 (23个)
2009/06/11 Javascript
浅析Prototype的模板类 Template
2011/12/07 Javascript
验证手机号码的JS方法分享
2013/09/10 Javascript
js获取上传文件大小示例代码
2014/04/10 Javascript
jquery+css实现绚丽的横向二级下拉菜单-附源码下载
2015/08/23 Javascript
微信小程序 欢迎页面的制作(源码下载)
2017/01/09 Javascript
vue中阻止click事件冒泡,防止触发另一个事件的方法
2018/02/08 Javascript
详解vue项目接入微信JSSDK的坑
2018/12/14 Javascript
es6中使用map简化复杂条件判断操作实例详解
2020/02/19 Javascript
[02:17]2016国际邀请赛中国区预选赛VG战队领队采访
2016/06/26 DOTA
[00:56]跨越时空加入战场 全新祈求者身心“失落奇艺侍祭”展示
2019/07/20 DOTA
[09:13]DOTA2-DPC中国联赛 正赛 Ehome vs Magma 选手采访 1月19日
2021/03/11 DOTA
树莓派中python获取GY-85九轴模块信息示例
2013/12/05 Python
Python的函数嵌套的使用方法
2014/01/24 Python
解析Python中的变量、引用、拷贝和作用域的问题
2015/04/07 Python
使用Python3制作TCP端口扫描器
2017/04/17 Python
Python语言生成水仙花数代码示例
2017/12/18 Python
Python编程scoketServer实现多线程同步实例代码
2018/01/29 Python
python实现指定文件夹下的指定文件移动到指定位置
2018/09/17 Python
Python中的random.uniform()函数教程与实例解析
2019/03/02 Python
numpy ndarray 按条件筛选数组,关联筛选的例子
2019/11/26 Python
Django 404、500页面全局配置知识点详解
2020/03/10 Python
Python+logging输出到屏幕将log日志写入文件
2020/11/11 Python
python的dict判断key是否存在的方法
2020/12/09 Python
德国baby-markt婴儿用品瑞士网站:baby-markt.ch
2017/06/09 全球购物
Java的基础面试题附答案
2016/01/10 面试题
购房协议书范本
2014/04/11 职场文书
幼儿园六一亲子活动方案
2014/08/26 职场文书
房屋租赁协议书(标准版)
2014/10/02 职场文书
golang中实现给gif、png、jpeg图片添加文字水印
2021/04/26 Golang
MyBatis-Plus 批量插入数据的操作方法
2021/09/25 Java/Android