我正在尝试使用令人敬畏的 5 svg 字体作为背景图像。但是,它没有出现,我不知道如何更改颜色。这就是我正在使用的:
.no-profile-image {
display: block;
width: 100%;
padding-bottom: 100%;
background: url('/images/fa-solid.svg#user');
background-size: contain;
background-position: center center;
}
我可以将它用作 html svg 元素,但是我不能像上面的背景图像那样使项目成为正方形。我尝试了以下方法,但它使元素成为椭圆形:
svg.no-profile-image {
width: 100%;
padding-bottom: 100%;
}
<svg class="no-profile-image">
<use xlink:href="/images/fa-solid.svg#user" fill="white"></use>
</svg>
我怎样才能使它成为背景图像,使我的 div 是方形的,或者使它成为方形的 html svg 元素?