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

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

不言
Release: 2018-10-12 16:53:15
forward
6332 people have browsed it

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>
Copy after login

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;
}
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template