【问题标题】:How can I move this zigzag border to the left side instead of the bottom?如何将此锯齿形边框移动到左侧而不是底部?
【发布时间】:2018-03-16 14:07:35
【问题描述】:

我的元素底部有一个锯齿形边框。我怎样才能将它移到左侧的边框呢?

.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>

【问题讨论】:

标签: html css border


【解决方案1】:

您应该能够更改线性渐变度以实现此目的,background-repeat 设置为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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多