Как сделать задний темно-зеленый как на фото и закрепить его там?
Хотел бы спросить у вас - как сделать задний темно-зеленый блок как на фото и закрепить его, то есть чтобы н оставался там же при сужение екрана?
Ответы (2 шт):
Автор решения: Andrei
→ Ссылка
Можно сделать так, как один из способов:
body {
display: grid;
justify-content: center;
align-content: center;
}
.containet {
display: grid;
width: 300px;
height: 300px;
justify-content: center;
align-content: center;
}
.containet>img {
width: 200px;
grid-row: 1/-1;
grid-column: 1/-1;
margin-left: 60px;
}
.circle {
border-radius: 50%;
background-color: green;
width: 260px;
height: 260px;
grid-row: 1/-1;
grid-column: 1/-1;
}
<div class="containet">
<div class="circle"></div><img src="https://funart.pro/uploads/posts/2021-04/1618405484_27-funart_pro-p-milie-detki-deti-krasivo-foto-29.jpg" alt="Girl">
</div>
Автор решения: Rudi
→ Ссылка
Как вариант, можно сделать так..
.container {
width: 300px;
height: 300px;
margin: 0 auto;
position: relative;
}
.picture {
background: 0 0 / cover url('https://i.stack.imgur.com/qDYHa.jpg');
width: 260px;
height: 260px;
border: solid #5EAADF 3px;
border-radius: 5px;
}
.picture:after {
content: '';
position: absolute;
left: -20%;
border-radius: 50%;
background-color: #254D4D;
width: 260px;
height: 260px;
z-index: -1;
}
<div class="container">
<div class="picture"></div>
</div>
