2013-12-11 70 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>