您现在的位置是:网站首页> 编程资料编程资料

CSS实现反方向圆角的示例代码_CSS教程_CSS_网页制作_

2023-11-04 244人已围观

简介 这篇文章主要介绍了CSS实现反方向圆角的示例代码的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

原理

父级元素 relative,子元素 absolute,然后通过topleftrightbottom来设置具体出现位置。

DOM结构

CSS样式

 .wrapper-dashed{ position: relative; height: 1px; width: 100%; } /*虚线实现*/ .dashed { border-top: 1px dashed #cccccc; height: 1px; overflow: hidden; } .dashed:before, .dashed:after{ display: block; position: absolute; content: ""; width:10px; height:10px; background-color:#f3f5f9; border-radius:50%; top: -5px; } .dashed:before{ left: -5px; } .dashed:after{ right: -5px; }

效果图

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

-六神源码网