【发布时间】:2014-12-15 19:51:22
【问题描述】:
我正在尝试用一个指向下方的小箭头画一条线,如附图所示。
我能够在使用伪标签之前和之后(使用help from Stack overflow)让它在小提琴上工作。
<hr class="line">
http://jsfiddle.net/4eL39sm1/6/
但我现在需要在这样的 div 标签中使用它
<div class="hr"></div>
我已经相应地编辑了我的 css
div.hr{
width:70%;
}
div.hr:after {
content:'';
position: absolute;
border-style: solid;
border-width: 15px 15px 0;
border-color: #FFFFFF transparent;
display: block;
width: 0;
z-index: 1;
top: 8px;
left: 45%;
}
div.hr:before {
content:'';
position: absolute;
border-style: solid;
border-width: 15px 15px 0;
border-color: #7F7F7F transparent;
display: block;
width: 0;
z-index: 1;
top: 9px;
left: 45%;
}
我做了这两个观察:
- 箭头部分看起来是一个实心三角形。
- 箭头(三角形错位在顶部)。我从 css 中删除了顶部值,它对齐得很好,但它仍然看起来像一个三角形。
有什么办法可以解决这个问题吗?
谢谢。
【问题讨论】:
-
你想要jsfiddle.net/4eL39sm1/8这样的东西吗?