- Set the gradient on half of the container with
background-size: 100% 50%
,
- Position the gradient circle so that only its top half is visible with
background-image: radial-gradient(circle 50vh at 50% 100%, #00bffb, #0000);
Explanation:
circle 50vh
sets the gradient radius to half the size of the container (you need to use a fixed size, thus 50vh
, or 200px
if your container was 400px tall — % won't work, sadly)
at 50% 100%
sets the gradient center in the middle of the bottom edge of the background box.
body {
width: 100vh;
height: 100vh;
background-color: #000;
background-image: radial-gradient(circle 50vh at 50% 100%, #00bffb, #0000);
background-size: 100% 50%;
background-repeat: no-repeat;
}
https://codepen.io/hyvyys/pen/xxKRGwP
It's impossible to edit HTML
, I would have done it if I could. – Basir