0


冰墩墩 HTML+CSS

效果图

代码 :

css:

  1. <style type="text/css">
  2. * { margin: 0; padding: 0 }
  3. body {
  4. font: 15px "Microsoft YaHei", Arial, Helvetica, sans-serif;
  5. background: #d4ebf1; color: #000; background-attachment: fixed;
  6. }
  7. .bdd {
  8. position: absolute;
  9. left: 50%;
  10. top: 50%;
  11. width: 520px;
  12. height: 500px;
  13. margin-top: -250px;
  14. margin-left: -260px;
  15. }
  16. .m_body {
  17. width: 362px;
  18. height: 410px;
  19. border: #393939 8px solid;
  20. margin: 50px auto;
  21. border-radius: 88% 88% 62% 68% / 82% 82% 95% 84%;
  22. position: absolute;
  23. left: 109px;
  24. top: -30px;
  25. background: #fff;
  26. }
  27. .earL, .earR {
  28. background: #393939;
  29. width: 81px;
  30. height: 115px;
  31. border-radius: 50%;
  32. position: absolute;
  33. z-index: -1;
  34. }
  35. .earL {
  36. left: 150px;
  37. top: 26px;
  38. transform: rotate( -10deg );
  39. }
  40. .earR {
  41. left: 362px;
  42. top: 28px;
  43. transform: rotate(10deg);
  44. }
  45. .eyeL, .eyeR {
  46. background: #393939;
  47. width: 83px;
  48. height: 115px;
  49. border-radius: 50%;
  50. position: absolute;
  51. }
  52. .eyeL {
  53. left: 185px;
  54. top: 122px;
  55. transform: rotate(45deg);
  56. }
  57. .eyeR {
  58. left: 329px;
  59. top: 122px;
  60. transform: rotate(-45deg);
  61. }
  62. .eyeL:before, .eyeR:before {
  63. content: "";
  64. width: 40px;
  65. height: 40px;
  66. border: #fff 5px solid;
  67. border-radius: 100%;
  68. position: absolute;
  69. }
  70. .eyeL:before {
  71. right: 10px;
  72. top: 22px;
  73. }
  74. .eyeR:before {
  75. left: 10px;
  76. top: 22px;
  77. }
  78. .eyeL:after, .eyeR:after {
  79. content: "";
  80. width: 10px;
  81. height: 10px;
  82. background: #9b9b9b;
  83. border-radius: 100%;
  84. position: absolute;
  85. }
  86. .eyeL:after {
  87. right: 27px;
  88. top: 31px;
  89. }
  90. .eyeR:after {
  91. left: 41px;
  92. top: 44px;
  93. }
  94. .face {
  95. position: absolute;
  96. border-radius: 48% 48% 44% 49%/ 53% 54% 45% 47%;
  97. }
  98. .c_blue {
  99. border: #6bcdf3 5px solid;
  100. width: 280px;
  101. height: 224px;
  102. left: 150px;
  103. top: 78px;
  104. }
  105. .c_red {
  106. border: #af2350 5px solid;
  107. width: 287px;
  108. height: 233px;
  109. left: 146px;
  110. top: 73px;
  111. }
  112. .c_purple {
  113. border: #5d75b3 5px solid;
  114. width: 295px;
  115. height: 240px;
  116. left: 142px;
  117. top: 70px;
  118. }
  119. .c_yellow {
  120. border: #ffc346 5px solid;
  121. width: 305px;
  122. height: 248px;
  123. left: 137px;
  124. top: 65px;
  125. }
  126. .c_green {
  127. border: #7fcb58 5px solid;
  128. width: 313px;
  129. height: 256px;
  130. left: 133px;
  131. top: 61px;
  132. }
  133. .armL, .armR {
  134. background: #333;
  135. position: absolute;
  136. z-index: -1;
  137. }
  138. .armL {
  139. width: 75px;
  140. height: 118px;
  141. left: 64px;
  142. top: 244px;
  143. transform: rotate(45deg);
  144. border-radius: 24% 69% 68% 76%/ 53% 95% 40% 52%;
  145. }
  146. .armR {
  147. width: 75px;
  148. height: 148px;
  149. left: 463px;
  150. top: 162px;
  151. transform: rotate(37deg);
  152. border-radius: 56% 62% 98% 6%/ 40% 46% 80% 58%;
  153. }
  154. .armR:before {
  155. content: "";
  156. width: 16px;
  157. height: 24px;
  158. background: #bc242c;
  159. position: absolute;
  160. border-top-left-radius: 50%;
  161. border-top-right-radius: 50%;
  162. transform: rotate(45deg);
  163. left: 32px; top: 20px;
  164. }
  165. .armR:after {
  166. content: "";
  167. width: 16px;
  168. height: 24px;
  169. background: #bc242c;
  170. position: absolute;
  171. border-top-left-radius: 50%;
  172. border-top-right-radius: 50%;
  173. transform: rotate(-45deg);
  174. left: 26px;
  175. top: 20px;
  176. }
  177. .arm_c {
  178. content: "";
  179. width: 16px;
  180. height: 24px;
  181. position: absolute;
  182. left: 426px;
  183. top: 20px;
  184. }
  185. .nose{
  186. background-color: #333333;
  187. position: absolute;
  188. left: 284px;
  189. top: 187px;
  190. width: 28px;
  191. height: 18px;
  192. border-radius: 42px 42px 60px 61px/ 30px 30px 50px 46px;
  193. }
  194. .mouse {
  195. position: absolute;
  196. left: 265px;
  197. top: 205px;
  198. width: 68px;
  199. height: 25px;
  200. border-radius: 48%;
  201. border: #393939 7px solid;
  202. border-top: none;
  203. border-left: 0;
  204. border-right: 0;
  205. }
  206. .legL, .legR {
  207. background: #333;
  208. position: absolute;
  209. width: 83px;
  210. height: 80px;
  211. border-radius: 0 0 30px 30px;
  212. z-index: -1;
  213. }
  214. .legL {
  215. left: 187px;
  216. top: 423px;
  217. }
  218. .legR {
  219. left: 328px;
  220. top: 423px;
  221. }
  222. .legL:after, .legR:after {
  223. content: "";
  224. width: 43px;
  225. height: 30px;
  226. position: absolute;
  227. background: #333;
  228. border-radius: 30px;
  229. }
  230. .legL:after {
  231. bottom: 0;
  232. right: -3px;
  233. }
  234. .legR:after {
  235. bottom: 0;
  236. left: -3px;
  237. }
  238. </style>

html:

  1. <div class="bdd">
  2. <div class="m_body"></div>
  3. <div class="earL"></div>
  4. <div class="earR"></div>
  5. <div class="eyeL"></div>
  6. <div class="eyeR"></div>
  7. <div class="face c_blue"></div>
  8. <div class="face c_red"></div>
  9. <div class="face c_purple"></div>
  10. <div class="face c_yellow"></div>
  11. <div class="face c_green"></div>
  12. <div class="nose"></div>
  13. <div class="mouse"></div>
  14. <div class="armL"></div>
  15. <div class="armR"></div>
  16. <div class="legL"></div>
  17. <div class="legR"></div>
  18. </div>
标签: css html css3

本文转载自: https://blog.csdn.net/weixin_54112552/article/details/122855648
版权归原作者 weixin_54112552 所有, 如有侵权,请联系我们删除。

“冰墩墩 HTML+CSS”的评论:

还没有评论