经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » HTML/CSS » CSS » 查看文章
css圆形镂空(优惠券背景图)的实现_CSS教程_CSS
来源:jb51  时间:2021/3/1 19:16:02  对本文有异议

本文主要介绍了css圆形镂空(常用做优惠券背景图),分享给大家,具体如下:

  1. .hollow-compose-three-circles {
  2. width: 300px;
  3. height: 100px;
  4. position: relative;
  5. background: radial-gradient(circle at right top, transparent 10px, #00adb5 0) top left / 60px 51% no-repeat,
  6. radial-gradient(circle at right bottom, transparent 10px, #00adb5 0) bottom left /60px 51% no-repeat,
  7. radial-gradient(circle at left top, transparent 10px, #eeeeee 0) 60px 0/230px 51% no-repeat,
  8. radial-gradient(circle at left bottom, transparent 10px, #eeeeee 0) 60px 50px /230px 51% no-repeat,
  9. radial-gradient(circle at 10px 50px, transparent 10px, #eeeeee 0) 290px 0/10px 100px no-repeat;
  10. filter: drop-shadow(2px 2px 2px rgba(0,0,0,.2));
  11. }
  12.  
  13. .hollow-compose-three-circles::after {
  14. content: '';
  15. height: 80px;
  16. border: 1px dashed #fff;
  17. position: absolute;
  18. left: 60px;
  19. top: 0;
  20. bottom: 0;
  21. margin: auto;
  22. }
  23. <div class="hollow-compose-three-circles"></div>

效果图
 

  1. <!doctype html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <title>process</title>
  5. <style>
  6. body{
  7. background: gray;
  8. }
  9. .many-circles {
  10. margin: 10px 0 0 40px;
  11. width: 200px;
  12. height: 100px;
  13. background: radial-gradient(circle at right, transparent 10px, #00adb5 0) top right / 51% 60px no-repeat,
  14. radial-gradient(circle at left, transparent 10px, #00adb5 0) top left / 51% 60px no-repeat;
  15. /*radial-gradient(circle at top right, transparent 10px, #eeeeee 0) bottom right / 51% 40px no-repeat,
  16. radial-gradient(circle at left top, transparent 10px, #eeeeee 0) bottom left / 51% 40px no-repeat;*/
  17. filter: drop-shadow(2px 2px 2px rgba(0,0,0,.2));
  18. }
  19.  
  20. </style>
  21. </head>
  22. <body>
  23. <div data-v-85036100="" class="many-circles"></div>
  24. <script>
  25. </script>
  26. </body>
  27. </html>

效果如下

在这里插入图片描述

  1. <style>
  2. body{
  3. background: gray;
  4. }
  5. .hollow-one-circle{
  6. display: inline-block;
  7. width: 246px;
  8. height: 218px;
  9. position: relative;
  10. background: radial-gradient(circle at 0 106px, transparent 10px, #FF4654 0) top left/246px 100% no-repeat;
  11. }
  12. .hollow-one-right{
  13. display: inline-block;
  14. width: 718px;
  15. height: 218px;
  16. position: relative;
  17. background: radial-gradient(circle at 718px 106px, transparent 10px, #ffffff 0) top left/718px 100% no-repeat;
  18. box-shadow:3px 0px 13px 0px rgba(0,0,0,0.03);
  19. }
  20.  
  21. .hollow-one-circle::before {
  22. content: '';
  23. position: absolute;
  24. height: 100%;
  25. width:5px;
  26. top: 4px;
  27. left: 246px;
  28. background-image: linear-gradient(to bottom, #FF4654 5px, transparent 5px, transparent),
  29. radial-gradient(10px circle at 5px 10px, transparent 5px, #FF4654 5px);
  30. background-size: 5px 15px;
  31. }
  32. .hollow-one-circle:after {
  33. }
  34. </style>
  35. <div data-v-85036100="" class="hollow-one-circle"></div>
  36. <div data-v-85036100="" class="hollow-one-right"></div>

效果如下

到此这篇关于css圆形镂空(常用做优惠券背景图)的文章就介绍到这了,更多相关css 圆形镂空内容请搜索w3xue以前的文章或继续浏览下面的相关文章,希望大家以后多多支持w3xue!

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号