Draw a curve with css

后端 未结 2 999
有刺的猬
有刺的猬 2020-12-02 17:03

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, mak

相关标签:
2条回答
  • 2020-12-02 17:43

    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>

    0 讨论(0)
  • 2020-12-02 17:45

    @Navaneeth and @Antfish, no need to transform you can do like this also because in above solution only top border is visible so for inside curve you can use bottom border.

    .box {
      width: 500px;
      height: 100px;
      border: solid 5px #000;
      border-color: transparent transparent #000 transparent;
      border-radius: 0 0 240px 50%/60px;
    }
    <div class="box"></div>

    0 讨论(0)
提交回复
热议问题