Is it possible to make a squiggly line?

前端 未结 12 1668
无人及你
无人及你 2021-02-01 19:04

If I wanted to make a horizontal line, I would do this:




        
12条回答
  •  盖世英雄少女心
    2021-02-01 19:37

    if you are not looking for something really neat, but just for the fun of it, play with multiple box-shadow: http://codepen.io/gcyrillus/pen/mfGdp or http://codepen.io/gcyrillus/pen/xhqFu

    .curve{
      margin:3em 0;
      width:100px;
      height:150px;
      border-radius:50%;
      box-shadow:
        0px 2px 1px -1px,
        400px 0px 0px 0px white,
        400px 2px 1px -1px ,
        300px 0px 0px 0px white,
        300px -2px 1px -1px,
        600px 0px 0px 0px white,
        600px 2px 1px -1px ,
        500px 0px 0px 0px white,
        500px -2px 1px -1px,
        800px 0px 0px 0px white,
        800px 2px 1px -1px ,
        700px 0px 0px 0px white,
        700px -2px 1px -1px,
        1000px 0px 0px 0px white,
        1000px 2px 1px -1px ,
        900px 0px 0px 0px white,
        900px -2px 1px -1px,
        1200px 0px 0px 0px white,
        1200px 2px 1px -1px ,
        1100px 0px 0px 0px white,
        1100px -2px 1px -1px,
        1400px 0px 0px 0px white,
        1400px 2px 1px -1px ,
        1300px 0px 0px 0px white,
        1300px -2px 1px -1px,
        1600px 0px 0px 0px white,
        1600px 2px 1px -1px ,
        1500px 0px 0px 0px white,
        1500px -2px 1px -1px;
      position:relative;
    }
    .curve:before,.curve:after {
      content:'';
      position:absolute;
      height:100%;
      width:100%;
      border-radius:100%;
      box-shadow:inherit;
    }
    .curve:before {
      left:100%;
      transform:rotate(180deg);
     }
    .curve:after {
      left:200%;
    }
    

提交回复
热议问题