2013-12-11 67 views

回答

2

這似乎給我,你要this

.pencil { 
    position: absolute; 
    bottom: 0; 
    left: 50%; 
    margin-left: -5px; 
    background: #55A5FF; 
    width: 20px; 
    height: 150px; 
} 

.pencil:before, .pencil:after { 
    width:10px; 
    background: #4264E8; 
    height: 150px; 
    content: ""; 
    display: block; 
    position: absolute; 
} 
.pencil:before { 
    left: -10px; 
} 

.pencil:after { 
    right: -10px; 
} 

千萬不要忘記位置您的僞元素。

但是,我沒有看到這是如何必要的。你可以用border-leftborder-right獲得完全相同的結果。

+0

This hit the spot,謝啦。注意:我明確沒有使用邊界,以便在僞類之前和之後學習。 – Machinarius

0

可以使鉛筆這樣

HTML標記

DIV CLASS = 「向上箭頭」>/DIV div class =「arrow-down」/ div

<style> 
.arrow-up 
{ 
    width:40px; 
    height:150px; 
    background:#000; 

} 

.arrow-down { 
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent; 
    border-right: 20px solid transparent; 

    border-top: 20px solid #f00; 
} 


</style>