当前位置:   article > 正文

【CSS】 画优惠券锯齿边框样式_css锯齿边框

css锯齿边框

红色左右锯齿样式:
在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<div class="coupon-input-container"></div>
<style>
.coupon-input-container {
    position: relative;
    background:  #aa0020;
    display: flex;
    width: 280px;
    min-height: 50px;
    padding: 6px 0 6px 15px;
    color: #fff;
    margin-top: 25px;
    align-items: center;
}

.coupon-input-container::before {
    content: ' ';
    width: 0;
    height: 100%;
    width: 0;
    position: absolute;
    border-right: 6px dotted white;
    top: 0;
    left: -3px;    
}

.coupon-input-container::after {
    content: ' ';
    height: 100%;
    position: absolute;
    border-left: 6px dotted white;
    top: 0;
    right: -3px;    

}    
</style>    
</body>
</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46

参考蓝色上下锯齿样式:
在这里插入图片描述

<!DOCTYPE html>
<html lang="en">


<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>




<style>
    .dotted {
        position: relative;
        background: -o-linear-gradient(left, #5d95e0, #697dde);
        background: -o-linear-gradient(right, #5d95e0, #697dde);
        background: -moz-linear-gradient(right, #5d95e0, #697dde);
        background: linear-gradient(to right, #5d95e0, #697dde);
        width: 300px;
        height: 200px;
    }


.dotted::before {
    content: ' ';
    width: 0;
    /* height: 100%; */
    height: 0;
    width: 100%;
    position: absolute;
    border-bottom: 10px dotted white;
    top: -5px;
    left: 0px;


}
    

.dotted::after {
    content: ' ';
    height: 0;
    width: 100%;
    position: absolute;
    border-bottom: 10px dotted white;
    bottom: -5px;
    left: 0px;
}
</style>


<body>
    <div class="dotted"></div>
</body>


</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59

参考:用CSS来实现优惠券上的锯齿效果

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

闽ICP备14008679号