在CSS中使用Javascript / jQuery制作边框右镜像边框?

时间:2016-05-30 00:10:04

标签: javascript jquery css

首先,让我为我的无知道歉。我是一个刚刚尝试学习绳索的新开发人员,我在这里遇到了障碍。我将简要解释一下我的WP设置:

部分div>章节类> section :: before和::之后的伪元素。

我继承了我的伪,所以当我使用我的前端编辑器来改变边框颜色大小等时,伪跟随。但是,它仅影响与其父级相同的边框。我想要做的是使用:: after伪的边界右边使用与边界底值相同的值。

希望这是有道理的。我希望我能用更清楚的方式解释我要追求的东西。如果我需要澄清任何事情,请告诉我。谢谢!

    /* Triangles */
.ss-style-triangles::before,
.ss-style-triangles::after {
    left: 50%;
    width: 50px;
    height: 50px;
    -webkit-transform: translateX(-50%) rotate(45deg);
    transform: translateX(-50%) rotate(45deg);
  border: inherit;
}

.ss-style-triangles::before {
    display: none;
  border: inherit;
  top: -25px;
    background: inherit;
  z-index: -9999;
}

.ss-style-triangles::after {
  border-right: solid 1px;
  bottom: -26px;
    z-index: 0;
    background: inherit;
}

1 个答案:

答案 0 :(得分:0)

在我自己的代码实验中,这里是

* {
    margin: 0;
    padding: 0;
}

.clearfix {
    padding: 50px;
}

#content {
    width: 100%;
    padding: 10% 0 0;
    background-color: #E8E8E8;
}

#content h1, #content h3 {
    text-align: center;
    color: black;
    font-weight: 100;
    font-family: Segoe UI;
}

#content h1 {
    font-size: 65px;
}

#content h3 {
    font-size: 35px;
    margin-top: 10px;
}

.block-left {
    border-bottom: 1px solid #c00000;
    float: left;
    width: 50%;
}

.block-right {
    border-bottom: 1px solid black;
    float: right;
    width: 50%;
}

.arrow-down {
    border-top: 20px solid #E8E8E8;
    border-bottom: 20px solid transparent;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    width: 0;
    margin: -1px auto;
    position: relative;
    z-index: 1;
}

.arrow-down::before,
.arrow-down::after {
    content: "";
    display: block;
    width: 1px;
    height: 28px;
}

.arrow-down::before {
    background-color: #c00000;
    transform: rotate(-45deg);
    margin-top: -23px;
    margin-left: -10px;
}

.arrow-down::after {
    background-color: #000000;
    transform: rotate(45deg);
    margin-top: -28px;
    margin-left: 9px;
}
<div id="content">
    <h1>What We Offer</h1>
    <h3>We offer many classes to help you build your skills, or to just have fun.</h3>
    <h3>Check out the list below!</h3>
    <div class="clearfix"></div>
    <div class="block-left"></div>
    <div class="block-right"></div>
</div>
<div class="arrow-down"></div>