首页 > 解决方案 > 更改在 css 中导入的 svg 的背景

问题描述

我有一堂课如下

.Collapsible__trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 400;
  text-decoration: none;
  position: relative;
  border: 1px solid white;
  padding: 10px;
  color: #333;


  &:after {
    content: '';
    background-image:url('/icons/plus.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    display: inline-block;
    width: 10px;
    height: 10px;
    transition: transform 300ms;
  }

我在 psudo 之后通过 background-img 导入了一个 svg。我如何更改 svg 的颜色,因为填充属性不起作用。

标签: htmlcsssvgsassbackground

解决方案


推荐阅读