css利用伪元素实现发票样式的边框

编程入门 行业动态 更新时间:2024-10-23 09:33:42

css利用伪元素实现发票样式的<a href=https://www.elefans.com/category/jswz/34/1766074.html style=边框"/>

css利用伪元素实现发票样式的边框

效果:

代码如下:

.invoice-content {position: relative;width: 622px;height: 148px;background-color: $itemSelectedBgColor;border: 2px dotted $mainGreenColor;li {height: 74px;line-height: 74px;font-size: 28px;color: $wrapperTextColor;.label {float: left;margin-left: 24px;}.content {float: right;max-width: 340px;margin-right: 24px;font-weight: bold;color: $TextColor;}i {color: $deleteColor;}}}.invoice-content:before {content: '';position: absolute;top: 58px;left: -16px;width: 32px;height: 32px;background-color: #fff;border-right: 2px dotted $mainGreenColor;border-radius: 0 50px 50px 0; // 将左上和左下角的radius设置为0以改善效果}.invoice-content:after {content: '';position: absolute;top: 58px;right: -16px;width: 32px;height: 32px;background-color: #fff;border-left: 2px dotted $mainGreenColor;border-radius: 50px 0 0 50px; // 将右上和右下角的radius设置为0以改善效果}

 实现: 利用伪类先在元素的左右两侧画一个带边框的圆,然后将左侧圆的左半部分和右侧圆的有半部分的border-radius设置为0以保证效果

ps:上述css代码是从本人代码直接copy过来,颜色及class命名问题请自动忽略

更多推荐

css利用伪元素实现发票样式的边框

本文发布于:2024-02-10 16:39:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1676262.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边框   发票   样式   元素   css

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!