【发布时间】:2019-10-17 13:12:42
【问题描述】:
我需要画一个箭头,最好使用伪(:after 或 :before)元素。它应该看起来像这样: 但它看起来像这样:
这是我的代码:
HTML:
<div class="info">
<a href="http://www.bay42.io" class="arrow1"><p>Learn about our technology<span class="arrow-right"></p></span></a></div>
CSS:
.arrow-right:after{
content: "";
display:inline-block!important;
width:0;
height:0;
border-left:14px solid #C8A962;
border-top:14px solid transparent;
border-bottom: 14px solid transparent;
}
【问题讨论】:
-
您可以使用 characyere → 。请参阅:dev.w3.org/html5/html-author/charref 你会找到你需要的角色实体。对于伪,使用 content:"\2192"; + 字体大小来缩放它
-
CSS 不是绘图工具。您应该为此使用图像,或者更好的是,学习如何使用 SVG(一种合适的绘图工具)来完成这些简单的事情。
-
你不能只使用一个更有用、更容易使用的 SVG 吗?
标签: css pseudo-element