How can I create a soft curve in CSS?
.curveArea {
width: 500px;
height: 200px;
margin: 0 auto;
}
.mainBox {
height: 100%;
background: #fff;
overflow: hidden;
}
.curveSection {
width: 200%;
height: 100%;
border-radius: 50%;
background: #e44627;
top: 25%;
left: -50%;
right: 0;
position: relative;
border-top: 10px solid #fdedea;
}
<div class="curveArea">
<div class="mainBox">
<div class="curveSection"></div>
</div>
</div>
Curving background color center with css top to bottom
You can use multiple gradients like this:
<!DOCTYPE html>
<html>
<head>
<style>
#container {
height: 200px;
width: 400px;
background: radial-gradient(
ellipse 100% 40% at 50% 14%,
#E8F3F9 30%,
40%,
transparent 40%
),
conic-gradient(
at 50% 30.3%,
#E8F3F9 0.235turn,
transparent 0.235turn 0.765turn,
#E8F3F9 0.765turn
);
border: 1px dotted wheat;
}
</style>
</head>
<body>
<div id="container"></div>
</body>
</html>
How to draw a curve with just CSS
You can just do it using border-bottom
radius. Like this:
div{
background-color:blue;
width:500px;
height:90px;
border-bottom-left-radius:50%;
border-bottom-right-radius:50%;
}
<div></div>
How to create a curve on the top of a background?
You can adjust your code like below:
.box {
margin-top:90px; /* make it at lealst the same as the height of the pseudo element */
width:200px;
height:100px;
background:white;
position:relative;
}
.box:before,
.box:after{
content:"";
position:absolute;
bottom:100%;
width:50%;
left:0;
height:80px; /* adjust this to control the height */
background:
radial-gradient(50% 100% at bottom left, #fff 98%,#0000) top,
radial-gradient(50% 100% at top right , #0000 98%,#fff) bottom;
background-size:100% 50%;
background-repeat:no-repeat;
}
.box:after {
transform-origin:right;
transform:scaleX(-1);
}
body {
background:pink;
}
<div class="box">
</div>
Can I create a div with a Curved bottom?
CSS:
div{
background-color:black;
width:500px;
height:50px;
border-bottom-left-radius:50%;
border-bottom-right-radius:50%;
}
see is this ok for you
div {
background-color: black;
width: 500px;
height: 50px;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
}
<div>
</div>
Curved background image in CSS
Well, you can try this one on for size: http://jsfiddle.net/dg44thbr/10/
body {
margin: 0;
background: red;
}
div#back {
position: relative;
height: 100px;
background-image: url(http://wearepeak.co.uk/wp-content/uploads/2016/02/testimonial.jpg);
width: 100%;
border-bottom-left-radius: 250% 160px;
border-bottom-right-radius: 0;
margin-left: -2em;
padding-right: 2em;
}
<div id="back"></div>
Related Topics
How to Create a Box-Shadow That Covers the Entire Page
Scroll Bootstrap 4 Nav-Tabs Horizontally
Why Is a Div Longer Than Several Spans with the Same Content (Only in Chrome)
Twitter Bootstrap Select Arrow Missing
Font Awesome Icons Disappear After Refresh in Chrome
Absolute Positioning Ignoring Padding
Force Background Color Printing on Firefox
Using 100Vw and Vh Creates Extra Space Beyond Viewport Size. How to Get Rid of It
100% Width Minus Margin and Padding
How to Make Select Elements Shrink to Max-Width Percent Style Within Fieldset
How to Properly Display German Characters in HTML
Flexbox with Fixed Header and Footer and Scrollable Content
Overlay on HTML5 Fullscreen Video
Get Click Event of Each Rectangle Inside Canvas
How to Move an Element That's on the Top to the Bottom in Responsive Design