【问题标题】:Make 4 zigzag borders for div为 div 制作 4 个锯齿形边框
【发布时间】:2022-11-15 04:47:33
【问题描述】:

我怎样才能使something like this,但在边界的所有 4 侧(顶部、右侧、左侧、底部)?

【问题讨论】:

标签: css border


【解决方案1】:
.zigzag {
    position: relative;
    padding: 4px 4px 20px 4px;
    background: lightgray;
}

div>div {
  text-align: center;
  height: 200px;
}

.zigzag:after {
    background: linear-gradient(-45deg, #ffffff 16px, transparent 0), linear-gradient(45deg, #ffffff 16px, transparent 0);
    background-position: left-bottom;
    background-repeat: repeat-x;
    background-size: 32px 32px;
    content: " ";
    display: block;
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    height: 32px;
}

<div class="zigzag">
    <div>ZigZag</div>
</div>

【讨论】:

    猜你喜欢
    • 2012-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-04
    相关资源
    最近更新 更多