Here is what I have tried:
&__ellipse {
width: 297px;
height: 297px;
border-radius: 50%;
background: $orange;
position: relative;
img {
position: absolute;
bottom: 0;
right: 20px;
}
}
How can I hide only the bottom side? Something like this overflow-bottom: hide
, or clip path
I would do it like below using mask and gradient:
.box {
margin: auto;
padding: 0 35px 32px 0; /* to rectify the image position */
max-width: 200px;
/* the orange circle with gradient */
background: radial-gradient(circle closest-side, orange 85%, transparent 86%);
-webkit-mask:
/* show only the orange circle (same as background */
radial-gradient(circle closest-side, orange 85%, transparent 86%),
/* and also show 70% from the top */
linear-gradient(#fff, #fff) top/100% 70% no-repeat;
}
.box img {
display: block;
width: 100%;
}
<div class="box">
<img src="https://i.sstatic.net/8Kjvd.png">
</div>
Another version using multiple backoground. Easier to manage and responsive
.box {
display:inline-block;
--grad:radial-gradient(circle closest-side at 50% 58%, orange 97%, transparent 98%);
background:
url(https://i.sstatic.net/8Kjvd.png) 0 50%/contain no-repeat, var(--grad);
-webkit-mask: var(--grad), linear-gradient(#fff, #fff) top/100% 70% no-repeat;
}
.box::before {
content: "";
display: block;
padding-top: 100%;
}
<div class="box" style="width:300px"></div>
<div class="box" style="width:200px"></div>
<div class="box" style="width:100px"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With