How To Create Div With Curve In Css And Html5?
I am newbie in css world and I am trying to make responsive design like this using bootstrap,css and html5. but ended up like this. how to create same curve in div displaying in
Solution 1:
You should use percentage to define the border-radius
, in this way the curve will look like the one you want.
border-radius: 100%
Solution 2:
To get curved edges use border-radius
, the background can be achieved with linear-gradient
jsfiddle: https://jsfiddle.net/ojhcbepz/
html, body {
height: 100%;
}
div.outer {
width: 600px;
height: 250px;
background: linear-gradient(to bottom,blue 50%,red 0px);
padding: 20px0;
overflow: hidden;
}
div.inner {
height: 100%;
border-radius: 50%;
background: white;
margin: 0 -50px;
}
<divclass="outer"><divclass="inner"></div></div>
Solution 3:
well a simple solution maybe... use a small red dot image and repeat it in outer div and inner div has border-radius: 50%
<div style="background-image: red url("http://i.imgur.com/dXis68u.png") repeat;">
<div style="background-color: white; border-radius: 50%; text-align:center;" >
ABCDEFGH
</div>
</div>
(You can add two
's of height as you want to get those top and bottom borders)
Post a Comment for "How To Create Div With Curve In Css And Html5?"