问题
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