.fa-home:before {
content: "\f015";
}
<li>
<a href="/index.php" class="homelink">
<i class="fa fa-home"></i>
</a>
</li>
我想将导航栏中的“内容”属性“ home”值替换为导航栏中的相应图像。
这是我的“内容”属性的CSS
.fa-home:before
{
content: "\f015";
}
因此,现在我需要将其替换为“ header_home.png”图像。有人给我信息如何用图像替换它。
您可以使用类似这样的东西。您可以按照需要使用变换比例来控制图像的宽高比。如果我的问题正确无误。
.fa-home:before {
content:url(/concrete5/application/images/header_home.png);
transform: scale(1);
}
您也可以使用此方法来控制高度和宽度
.fa-home:before {
content:"";
display: inline-block;
width: 30px;
height: 30px;
background-image: url(/concrete5/application/images/header_home.png);
background-size: 30px 30px;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句