Как забрать background
body {
background-color: #333;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.block {
position: relative;
width: 200px;
height: 200px;
}
.block::after,
.block::before {
content: "";
width: calc(100% - 50px);
left: 50%;
transform: translateX(-50%);
height: 5px;
position: absolute;
background-color: #fff;
}
.block::before {
top: 0;
}
.block::after {
bottom: 0;
}
.block__inner {
position: relative;
height: inherit;
}
.block__inner::after,
.block__inner::before {
content: "";
width: 5px;
height: calc(100% - 50px);
top: 50%;
transform: translateY(-50%);
position: absolute;
background-color: #fff;
}
.block__inner::before {
left: 0;
}
.block__inner::after {
right: 0;
}
.corner {
position: absolute;
width: 50px;
height: 50px;
border: 5px solid #fff;
border-radius: 50%;
border-bottom-color: transparent;
}
.corner:nth-child(1),
.corner:nth-child(2) {
top: -30px;
border-top-color: transparent;
}
.corner:nth-child(1),
.corner:nth-child(3),
.corner:nth-child(4) {
border-left-color: transparent;
}
.corner:nth-child(1),
.corner:nth-child(3) {
left: -30px;
transform: rotate(45deg);
}
.corner:nth-child(2),
.corner:nth-child(4) {
right: -30px;
transform: rotate(-45deg);
}
.corner:nth-child(2),
.corner:nth-child(3),
.corner:nth-child(4) {
border-right-color: transparent;
}
.corner:nth-child(3),
.corner:nth-child(4) {
bottom: -30px;
}
<div class="block">
<div class="block__inner">
<div class="corner"></div>
<div class="corner"></div>
<div class="corner"></div>
<div class="corner"></div>
</div>
</div>
Ответы (1 шт):
Автор решения: Sevastopol'
→ Ссылка
body {
background-color: #333;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.block {
position: relative;
width: 200px;
height: 200px;
}
.block::after,
.block::before {
content: "";
width: calc(100% - 50px);
left: 50%;
transform: translateX(-50%);
height: 5px;
position: absolute;
background-color: #fff;
}
.block::before {
top: 0;
}
.block::after {
bottom: 0;
}
.block__inner {
z-index: -1;
border-radius: 50px;
background: url('https://www.syl.ru/misc/i/ai/427172/2871002.jpg') center center no-repeat;
background-size: cover;
position: relative;
height: inherit;
}
.block__inner::after,
.block__inner::before {
content: "";
width: 5px;
height: calc(100% - 50px);
top: 50%;
transform: translateY(-50%);
position: absolute;
background-color: #fff;
}
.block__inner::before {
left: 0;
}
.block__inner::after {
right: 0;
}
.corner {
position: absolute;
width: 50px;
height: 50px;
border: 5px solid #fff;
border-radius: 50%;
border-bottom-color: transparent;
background-color: #333;
}
.corner:nth-child(1),
.corner:nth-child(2) {
top: -30px;
border-top-color: transparent;
}
.corner:nth-child(1),
.corner:nth-child(3),
.corner:nth-child(4) {
border-left-color: transparent;
}
.corner:nth-child(1),
.corner:nth-child(3) {
left: -30px;
transform: rotate(45deg);
}
.corner:nth-child(2),
.corner:nth-child(4) {
right: -30px;
transform: rotate(-45deg);
}
.corner:nth-child(2),
.corner:nth-child(3),
.corner:nth-child(4) {
border-right-color: transparent;
}
.corner:nth-child(3),
.corner:nth-child(4) {
bottom: -30px;
}
<div class="block">
<div class="block__inner">
<div class="corner"></div>
<div class="corner"></div>
<div class="corner"></div>
<div class="corner"></div>
</div>
</div>

