zigzag border in css left side [closed]

2020-02-07 06:37发布

how to move the zig zag border to the left side?

  .zigzag {
  height: 150px;
  width: 400px;
  background: linear-gradient(-135deg, #e8117f 5px, transparent 0) 0 5px, linear-gradient(135deg, #e8117f 5px, #fff 0) 0 5px;
  background-color: #e8117f;
  background-position: left bottom;
  background-repeat: repeat-x;
  background-size: 10px 10px;
<div class="zigzag"></div>

Thx

enter image description here

标签: html css zigzag
1条回答
混吃等死
2楼-- · 2020-02-07 06:50

You should be able to change the linear-gradient degrees to achieve this, and set background-repeat to repeat-y.

  .zigzag {
    height: 150px;
    width: 400px;
    background: linear-gradient(-137deg, #e8117f 6px, transparent 0) 0 5px, linear-gradient(320deg, #e8117f 5px, #fff 0) 0 5px;
    background-color: #e8117f;
    background-position: left bottom;
    background-repeat: repeat-y;
    background-size: 10px 10px;
 }
<div class="zigzag"></div>

查看更多
登录 后发表回答