0
您好我想創建一個類似的小規模說字體真棒在哪裏我與我自己的圖標。css/less背景圖標定位左和中心
我有三個圖標:
sell.png (20px x 20px)
buy.png (20px x 20px)
cma.png (20px x 20px)
我的目標是有背景圖像是左和垂直對齊中間的文本。
這是我到目前爲止,但如果它工作,那麼...我不會在這裏!
<span class="amls amls-buy">buy</span>
<span class="amls amls-sell">sell</span>
<span class="amls amls-cma">cma</span>
CSS:
.amls {
display: inline-block;
font-style: normal;
padding-left: 22px;
position: relative;
:before {
background-repeat: none;
content: "";
display: block;
position: absolute;
left: 0; top: 2px;
height: 20px;
width: 20px;
}
}
.amls-buy:before {
background-image: url('img/buy.png')
}
非常感謝,讓我的生活更輕鬆 –
很高興我能幫忙! –