Reputation: 916
I was wondering how to make different shapes using CSS and I came across this one
Yes, I can make it using more than one element that's four circles and the background of the body, but is there any way so I can make it using a single div element?
we will have to make a square div with inside curves is that possible using CSS?
Upvotes: 1
Views: 114
Reputation: 273969
One div, one gradient
div {
width: 100px;
height: 100px;
border: solid gold;
border-width: 20px 40px;
background: radial-gradient(circle 50px, gold 98%, #0000) -50px -50px content-box green
}
<div></div>
Upvotes: 1
Reputation: 830
One possible way to do it:
path
value and you can put a svg path to it.Below is the implementation
<div class="container">
</div>
div.container {
height:300px;
width:300px;
background: #F3AC3C;
display:flex;
justify-content:center;
align-items: center;
}
div.container::before {
content: '';
display:block;
height:100%;
width:100%;
background: #1A4341;
clip-path: path('M150,70 q1,75 -76,75 q77,-1 76,76 q-1,-76 74,-77 q-74,0 -74,-74 q0.5,62.5 1,75 q-1,25 -2,0 q1,24.5 2,-1')
}
jsfiddle - https://jsfiddle.net/81wbLku2/
Upvotes: 1
Reputation: 115295
One div, 4 radial gradients.
div {
width: 80vh;
height: 80vh;
border: 1px solid red;
margin: 1em auto;
background-color: black;
background-image: radial-gradient(circle at 100% 0%, orange, orange 36%, transparent 36%), radial-gradient(circle at 0% 0%, orange, orange 36%, transparent 36%), radial-gradient(circle at 100% 100%, orange, orange 36%, transparent 36%), radial-gradient(circle at 0% 100%, orange, orange 36%, transparent 36%)
}
<div></div>
Upvotes: 3
Reputation: 6327
<div class="g">
<div class="y" style="border-bottom-right-radius: 100px;"></div>
<div class="y" style="border-bottom-left-radius: 100px;"></div>
<div class="y" style="border-top-right-radius: 100px;"></div>
<div class="y" style="border-top-left-radius: 100px;"></div>
</div>
* {
margin:0px;
padding: 0px;
}
.g {
background: #1A4341;
width: 400px;
height: 200px;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: 50% 50%;
}
.y {
background: #F3AC3C;
width: 100%;
height: 100%;
display: block;
}
Upvotes: -2
Reputation: 50
use can use border-radius style with 4 div : one div at left top location style is
border-radius: 0px 0px 100px 0px;
border: 10px solid #800000;
another div at right top location style is
border-radius: 0px 0px 0px 100px;
border: 10px solid #800000;
another div at right bottom location style is
border-radius: 100px 0px 0px 0px;
border: 10px solid #800000;
another div at left bottom location style is
border-radius: 0px 100px 0px 0px;
border: 10px solid #800000;
Upvotes: -2