div+css实现两个圆环嵌套重叠连接效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现两个圆环嵌套重叠连接效果代码

代码标签: div css 两个 圆环 嵌套 重叠 连接

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!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"/>
<style>

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #111
}

.box {
    position: relative;
    width: 340px;
    height: 200px;
    display: flex
}

.box .circle {
    position: relative;
    min-width: 200px;
    height: 200px;
    border: 25px solid #fff;
    border-radius: 50%
}

.box .circle:nth-child(2) {
    left: -60px;
    border: 25px solid #f00
}

.box .circle:nth-child(1)::before {
    content: '';
    position: absolute;
    inset: -25px;
    border: 25px solid transparent;
    border-top: 25px solid #fff;
    border-right: 25px solid #fff;
    border-radius: 50%;
    z-index: 100;
    transform: rotate(-45deg.........完整代码请登录后点击上方下载按钮下载查看

网友评论0