Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw a curve with css

Tags:

css

curve

I want to create an animation with css that simulate a wave movement.
I need to change a line-or div- to a curve for this...
The CSS rules that I'm familiar to, make the entire div to semicircular or change element border.
For example: border-radius, or perspective or border-top-radius...
This image show you what I want: curve

Do you have experience about this? or is it possible?
Thanks in Advance...

like image 230
Kiyarash Avatar asked Dec 27 '13 15:12

Kiyarash


People also ask

How do you draw a curve in CSS?

The CSS rules that I'm familiar to, make the entire div to semicircular or change element border. For example: border-radius , or perspective or border-top-radius ...


1 Answers

You could use an asymmetrical border to make curves with CSS.

border-radius: 50%/100px 100px 0 0;

VIEW DEMO

.box {    width: 500px;     height: 100px;      border: solid 5px #000;    border-color: #000 transparent transparent transparent;    border-radius: 50%/100px 100px 0 0;  }
<div class="box"></div>
like image 108
Elad Shechter Avatar answered Sep 23 '22 03:09

Elad Shechter