Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - rounded background

Is that possible in CSS?

enter image description here

If yes, how to do this? I tried with border-top-left-radius but its not the same.

like image 502
Patryk Lesiecki Avatar asked Oct 22 '25 04:10

Patryk Lesiecki


1 Answers

You can get pretty close setting the length and the percentage for border-*-*-radius.

div {
  width: 100%;
  height: 200px;
  background-color: red;
  border-top-left-radius: 50% 20px;
  border-top-right-radius: 50% 20px;
}

Here's a quick demo: https://jsfiddle.net/crswll/wqsebkpz/1/

and one with an image as proof that it works: https://jsfiddle.net/crswll/wqsebkpz/2/

You can find more details here: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#Formal_syntax

like image 122
Bill Criswell Avatar answered Oct 23 '25 19:10

Bill Criswell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!