2014-12-29 40 views
0

我使用的視覺作曲家插件,它可以很容易地創建列。我已經到了,我想創造一個環保總局列之間的視覺作曲家分隔線

列這怎麼能在一個簡單的方法來完成之間

html,body { height:100%;width:auto;} 
 

 
.left { 
 
float: left; 
 

 
} 
 
#w1 {width:22%; 
 
background-color:#009; 
 
    margin-right: 4%; 
 
    
 
} 
 
#w2{width:48%; 
 
background-color:#9F3; 
 
    margin-right: 4%; 
 
} 
 
#w3{ width:22%; 
 
background-color:#30C;}
<div class="left" id="w1">TEST</div> 
 
<div class="left" id="w2">TEST</div> 
 
<div class="left" id="w3">TEST</div>

rator線問題?我已經重新創建了3列如何設置:

回答

0

您可以使用:after:僞元素。

html, 
 
body { 
 
    height: 100%; 
 
    width: auto; 
 
} 
 
.left { 
 
    float: left; 
 
    position: relative; 
 
} 
 
#w1 { 
 
    width: 22%; 
 
    background-color: #009; 
 
    margin-right: 4%; 
 
} 
 
#w2 { 
 
    width: 48%; 
 
    background-color: #9F3; 
 
    margin-right: 4%; 
 
} 
 
#w3 { 
 
    width: 22%; 
 
    background-color: #30C; 
 
} 
 
.left:not(:nth-of-type(2)):after { 
 
    content: ''; 
 
    position: absolute; 
 
    right: -10%; 
 
    top: 0; 
 
    height: 100%; 
 
    width: 2px; 
 
    background: black; 
 
} 
 
.left:last-of-type:after { 
 
    right: 108%; 
 
}
<div class="left" id="w1">TEST</div> 
 
<div class="left" id="w2">TEST</div> 
 
<div class="left" id="w3">TEST</div>

+0

或http://jsfiddle.net/cpg93537/'。左:未(:第n的式(3N)):after' –

+0

和如何添加一個至正確的? –

+0

@PeterPik - 「添加一個正確的?」 - 在哪裏? –