【发布时间】:2016-05-30 11:22:59
【问题描述】:
我有一个图标设置为背景,如下图:
如您所见,箭头后面必须有填充物才能获得良好的空间。 我该如何解决这个问题?
HTML
<span class="arrowIcon">Newsletter Sign up</span>
CSS
.arrowIcon{
background-image:url(../img/arrow.png);
background-position:right center;
background-repeat:no-repeat;
background-color:#5379A5;
padding:10px;
color:#FFFFFF;
float:right;
width:55%;
}
【问题讨论】:
-
可以添加 background-position:90% center;
-
使用背景位置并根据需要调整 x 值。
标签: html css background-image positioning