Как вывести круг за границу секции?
Ответы (3 шт):
Автор решения: Август
→ Ссылка
C помощью svg:
svg {
background-color: #ea3c6e;
width: 500px;
height: 200px;
}
<svg>
<circle cx="300" cy="100" fill="#ed7599" r="150" />
<circle cx="300" cy="100" fill="#f3adc2" r="110" />
<image xlink:href="https://avatanplus.com/files/resources/mid/578a9bd01f9c7155f570a501.png" x="200" y="30" height="100" width="200" />
</svg>
С помощью градиента:
div {
width: 450px;
height: 200px;
background: radial-gradient(
circle at 60% 50%,
#f3adc2 0%,#f3adc2 45%,
#ed7599 45%, #ed7599, 60%,
#ea3c6e 60%, #ea3c6e 100%
);
}
<div></div>
Автор решения: Firsov36
→ Ссылка
Вот такой вариант
body {
text-align: center;
}
.shadow {
display: inline-block;
margin: 3em;
box-shadow: 0px 0px 0px 40px rgba(0,0,0,0.75);
border-radius: 50%;
position: relative;
}
.shadow::after {
display: block;
position: absolute;
top: 0; right: 0; left: 0; bottom: 0;
content: '';
box-shadow: 0px 0px 0px 60px rgba(0,0,0,0.35);
border-radius: 50%;
}
<div class="shadow">
<img src="http://i.imgur.com/AJ3tUOB.png" />
</div>
Автор решения: CbIPoK2513
→ Ссылка
Никаких хитрых трюков.
Правда придётся учитывать, что пример с фиксированной высотой.
.pre {
display: block;
width: 100%;
height: 240px;
background: #f13c6e;
position: relative;
}
.pre .img {
display: flex;
justify-content: center;
align-items: center;
width: 260px;
height: 260px;
border-radius: 100%;
background: rgba(255,255,255,.5);
position: absolute;
right: 80px;
top: -10px;
box-shadow: 0 0 0 40px rgba(255,255,255,.25);
}
.pre .img > img {
display: block;
width: 80%;
height: 80%;
object-fit: contain;
}
<div class="pre">
<div class="img">
<img src="https://i.imgur.com/SD43J2H.png">
</div>
</div>
