磁带对于一些小朋友来说可能不知道是什么东西,但对于70、80后来说装满了满满的回忆,今天我就用css画一个彩色壳子的磁带,如下图所示:
<html> <head> <meta charset="UTF-8"> <link rel="apple-touch-icon" type="image/png" href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png"> <meta name="apple-mobile-web-app-title" content="CodePen"> <link rel="shortcut icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico"> <link rel="mask-icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg" color="#111"> <title>css画一个彩色壳子的磁带www.woaidaogu.com</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> html, body { width: 100%; height: 100%; display: flex; } div { position: relative; width: 180px; height: 120px; margin: auto; border-radius: 5px; background-image: linear-gradient(to right, #444 10px, transparent 10px), linear-gradient(to left, #444 10px, transparent 10px), linear-gradient(135deg, #444 20px, transparent 20px), linear-gradient(-135deg, #444 20px, transparent 20px), linear-gradient(to bottom, transparent 35px, #be0974 35px, #be0974 43px, #da6a57 43px, #da6a57 51px, #eebc31 51px, #eebc31 59px, #92a25b 59px, #92a25b 67px, #46a7c0 67px, #46a7c0 75px, transparent 75px), linear-gradient(to bottom, transparent 10px, #f7f7f7 10px, #f7f7f7 85px, transparent 85px), linear-gradient(to top, transparent 26px, #444 26px), linear-gradient(105deg, #444 70px, #333 70px, #333 73px, transparent 73px), linear-gradient(-105deg, #444 70px, #333 70px, #333 73px, transparent 73px), linear-gradient(to top, #444 24px, #777 24px, #777 26px, #444 26px); box-shadow: -4px -4px 2px rgba(0, 0, 0, 0.2); } div:after { position: absolute; content: ""; width: 5px; height: 5px; background: #999; border-radius: 50%; box-shadow: 165px 0 0 #999, 0 104px 0 #999, 165px 104px 0 #999, 55px 101px 0 1px #222, 68px 98px 0 1px #222, 98px 98px 0 1px #222, 110px 101px 0 1px #222, 51px 38px 0 #444, 114px 38px 0 #444, 44px 46px 0 #444, 58px 46px 0 #444, 107px 46px 0 #444, 121px 46px 0 #444, 51px 53px 0 #444, 114px 53px 0 #444, 51px 46px 0 6px #ccc, 114px 46px 0 6px #ccc; left: 5px; top: 5px; } div:before { position: absolute; content: ""; width: 90px; height: 26px; margin-left: -45px; left: 50%; top: 41px; background-color: #ccc; background-image: linear-gradient(to bottom, #444 5px, transparent 5px), linear-gradient(to top, #444 5px, transparent 5px), linear-gradient(to right, #444 30px, transparent 30px), linear-gradient(to left, #444 30px, transparent 30px), radial-gradient(circle at 10px 12px, #a0522d 32px, transparent 32px); border-radius: 30px; } </style> <script> window.console = window.console || function (t) { }; </script> <script> if (document.location.search.match(/type=embed/gi)) { window.parent.postMessage("resize", "*"); } </script> </head> <body translate="no"> <div></div> <div id="xl_chrome_ext_{4DB361DE-01F7-4376-B494-639E489D19ED}" style="display: none;"> <div></div> <a id="xl_chrome_ext_download" href="javascript:;">下载视频</a> <a id="xl_chrome_ext_close" href="javascript:;"></a> </div> </body> </html>
通过以上内容我们知道了css如何画一个彩色壳子的磁带?感谢您访问“我爱捣鼓(www.woaidaogu.com)”网站的内容,希望对大家有所帮助!引用本文内容时,请注明出处!谢谢合作!