zigzag border in css left side [closed]

不问归期 提交于 2019-12-29 01:56:12

问题


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


回答1:


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>


来源:https://stackoverflow.com/questions/49322690/zigzag-border-in-css-left-side

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!