HTML _CSS
CSS Tricky Shape
HiroDaegu
2022. 12. 3. 13:54
728x90
SMALL

<!DOCTYPE html>
<html lang="ko">
<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">
<title>CSS TRICKY SHAPE</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="box">
<div class="circle"></div>
<div class="circle"></div>
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #111;
}
.box {
width: 340px;
height: 200px;
display: flex;
}
.box .circle {
min-width: 200px;
height: 200px;
border: 25px solid #FFF;
border-radius: 50%;
}
.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);
}
.box .circle:nth-child(1)::after {
content: '';
position: absolute;
inset: -25px;
border: 25px solid transparent;
border-right: 25px solid #000;
border-radius: 50%;
z-index: 1;
transform: rotate(-65deg);
filter: blur(15px);
}
.box .circle:nth-child(2) {
left: -60px;
border: 25px solid #F00;
}
.box .circle:nth-child(2)::before {
content: '';
position: absolute;
inset: -25px;
border: 25px solid transparent;
border-bottom: 25px solid #F00;
border-left: 25px solid #F00;
border-radius: 50%;
z-index: 100;
transform: rotate(-45deg);
}
.box .circle:nth-child(2)::after {
content: '';
position: absolute;
inset: -25px;
border: 25px solid transparent;
border-left: 25px solid #000;
border-radius: 50%;
z-index: 1;
transform: rotate(-65deg);
filter: blur(15px);
}728x90
LIST