2015-06-25 123 views

回答

2

使用伪元素和CSS三角:

.arrow-right, 
 
.arrow-left { 
 
    position: relative; 
 
    display: inline-block; 
 
    height: 20px; 
 
    padding: 0 6px; 
 
    color: white; 
 
    background-color: #A5A5A5; 
 
} 
 
.arrow-right::after, 
 
.arrow-left::after { 
 
    content: ''; 
 
    position: absolute; 
 
    top: 0; 
 
    width: 0; 
 
    height: 0; 
 
    border-style: solid; 
 
} 
 
.arrow-right::after { 
 
    right: -10px; 
 
    border-color: transparent transparent transparent #A5A5A5; 
 
    border-width: 10px 0 10px 10px; 
 
} 
 
.arrow-left::after { 
 
    left: -10px; 
 
    border-color: transparent #A5A5A5 transparent transparent; 
 
    border-width: 10px 10px 10px 0; 
 
}
<div class="arrow-right">Lorem</div> 
 
<br> 
 
<div class="arrow-left">Lorem</div>

+0

感谢它的作品:) –

+0

请考虑,这个箭头是为下一个帖子 那么上一篇文章箭头...我的意思是为下一个混合是在右侧......但对于以前的混合是必须的在左侧... 你能帮我创建一个以前的帖子的箭头 –

+1

添加'transform:rotate(180deg);'并改变'right:-10px;''left:-10px;'在' .arrow :: after'选择器来创建“上一个按钮” –