Home >Web Front-end >CSS Tutorial >How to achieve reverse rounded corners with CSS? (code)

How to achieve reverse rounded corners with CSS? (code)

不言
不言forward
2018-10-12 16:53:156319browse

The content of this article is about how to achieve reverse rounded corners in CSS? (code), it has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Principle

Parent elementrelative, child elementabsolute, and then pass top, left, right, bottom to set the specific appearance position.

DOM structure

<div>
    <div></div>
</div>

How to achieve reverse rounded corners with CSS? (code)

CSS style

.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;
}

Rendering

How to achieve reverse rounded corners with CSS? (code)

How to achieve reverse rounded corners with CSS? (code)

The above is the detailed content of How to achieve reverse rounded corners with CSS? (code). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete