How to Give a Div Oval Shape

How to give a div oval shape?

Is this OK ?

HTML

<div id="oval_parent">
<div id="oval"></div>
</div>

CSS

#oval_parent{
background:black;
width:200px;
height:120px;
overflow:hidden;
}

#oval{
width: 220px;
height: 100px;
margin:10px 0 0 -10px;
background: white;
-moz-border-radius: 100px / 50px;
-webkit-border-radius: 100px / 50px;
border-radius: 100px / 50px;
}

DEMO.

how to make an oval in css?

All you have to do is to change border-radius: 40px to border-radius: 50%.

.oval {  width: 160px;  height: 80px;  background: #a84909;  border-radius: 50%;}
<div class="oval"></div>

How to make a vertical oval type of shape div?

You can consider SVG as mask and you can easily obtain this shape.

.box {
width:300px;
display:inline-block;
background:url(https://picsum.photos/id/1074/800/800) center/cover;
-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 78' ><path d='M0 39 C0 61 8 78 32 78 C56 78 64 61 64 39 C64 19 56 0 32 0 C8 0 0 19 0 39 Z' /></svg>") 0 / 100% 100%;
mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 78' ><path d='M0 39 C0 61 8 78 32 78 C56 78 64 61 64 39 C64 19 56 0 32 0 C8 0 0 19 0 39 Z' /></svg>") 0 / 100% 100%;
}
.box::before {
content:"";
display:block;
padding-top:121%;
}
<div class="box"></div>

<div class="box" style="width:150px;"></div>

CSS div oval shape

body {
overflow-x: hidden
}

svg {
left: 47%;
position: relative;
top: -24%;
transform: translate(-50%, -50%);
width: 2000px;
}

div oval shape with corner with css

Use pseudo element to create this. The trick is to have a small overlap and you don't color that overlap:

.box {  width:150px;  height:200px;  position:relative;}.box:before,.box:after {  content:"";  position:absolute;  bottom:0;  width:70%;  box-sizing:border-box;  top:0;  bottom:0;  background-color:red;  background-clip:content-box; /* Don't color the padding */}.box:before {  left:0;  padding-right:20%; /* (70% - 50%)*/  border-radius: 150px 0 0 0;}.box:after {  right:0;  padding-left:20%;  border-radius: 0 150px 0 0;}
<div class="box">
</div>

How do you make a div shaped like an ellipse in CSS?

border-radius: 50% and transform: rotate(-10deg) are what you're looking for.

div {  height: 200px;  width: 400px;  border-radius: 50%;  transform: rotate(-10deg);  border: 1px solid;  background: #e1ecf4;}
<div></div>

How to make oval-ish shape in css

use radial-gradient without the need of border-radius