我正在尝试用背景图像覆盖/替换Font Awesome图标.我只有CSS访问权限. 我有什么: .btn.btn-default.bootstrap-touchspin-up:before { font-family: Fontawesome; content: "\f067"; font-size: 14px;} 我想要实现的目标:
我有什么:
.btn.btn-default.bootstrap-touchspin-up:before {
font-family: Fontawesome;
content: "\f067";
font-size: 14px;
}
我想要实现的目标:
.btn.btn-default.bootstrap-touchspin-up:before {
background-image : url(Images/arrows-left-right.png);
font-family: initial;
content: "";
font-size: 14px;
height: 20px;
width: 20px;
}
您需要这些附加属性
width: 15px; height: 15px; display: inline-block; background-position: center; background-size: contain;
正如@Alexander De Sousa在评论中所提到的,内联块更好的选择是保持一切内联.
