当前位置:   article > 正文

css画波浪线和齿状线_css 齿纹

css 齿纹
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>波浪线和齿状线</title>
  8. </head>
  9. <style>
  10. html,
  11. body {
  12. padding: 0;
  13. margin: 0;
  14. width: 100%;
  15. height: 100%;
  16. }
  17. .box {
  18. position: relative;
  19. margin: 200px auto 0;
  20. width: 300px;
  21. height: 90px;
  22. background: linear-gradient(to right, rgb(255, 85, 85), rgb(207, 224, 232));
  23. display: flex;
  24. justify-content: space-between;
  25. align-items: center;
  26. padding: 0 20px;
  27. box-sizing: border-box;
  28. }
  29. .left {
  30. display: flex;
  31. flex-direction: column;
  32. justify-content: center;
  33. /* align-items:center; */
  34. color: #ffffff;
  35. width: 60%;
  36. height: 100%;
  37. }
  38. .zhekou {
  39. font-size: 22px;
  40. }
  41. .tiaojian {
  42. font-size: 12px;
  43. margin-top: 10px;
  44. }
  45. .right {
  46. width: 40%;
  47. height: 100%;
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. }
  52. .btn {
  53. display: inline-block;
  54. padding: 8px 16px;
  55. border: 1px solid #ffffff;
  56. color: #ffffff;
  57. font-size: 14px;
  58. cursor: pointer;
  59. }
  60. .circle1 {
  61. position: absolute;
  62. z-index: 5;
  63. top: -8px;
  64. left: 0;
  65. transform-origin: center left;
  66. transform: rotate(90deg);
  67. width: 220px;
  68. height: 9px;
  69. background-image: radial-gradient(circle, #fff, #fff 4px, transparent 0px, transparent 2px, transparent 22px, transparent);
  70. background-size: 10px 10px;
  71. background-repeat: repeat-x;
  72. }
  73. .circle2 {
  74. position: absolute;
  75. z-index: 5;
  76. top: -8px;
  77. left: 160px;
  78. transform-origin: center left;
  79. transform: rotate(90deg);
  80. width: 160px;
  81. height: 12px;
  82. background-image: radial-gradient(circle, #fff, #fff 3px, transparent -4px, transparent 2px, transparent 22px, transparent);
  83. /* 主要是的内容是这句background-image;画好之后,根据你要放的位置来移动 */
  84. background-size: 8px 8px;
  85. background-repeat: repeat-x;
  86. }
  87. </style>
  88. <body>
  89. <div class="box">
  90. <div class="left">
  91. <span class="zhekou">8.00折</span>
  92. <span class="tiaojian">满10.00元可用</span>
  93. </div>
  94. <div class="right">
  95. <span class="circle3"></span>
  96. <span class="btn">点击领取</span>
  97. </div>
  98. <div class="circle1"></div>
  99. <div class="circle2"></div>
  100. </div>
  101. </body>
  102. </html>

在做项目的时候,遇到要画波浪线,所以在这里分享下代码

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/266216
推荐阅读
相关标签
  

闽ICP备14008679号