0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

疑似要素にsvgアイコンを使用する

Posted at

SVGアイコンの大きさを変えたい

        &::after {
          content: '';
          background-image:  url('svgのurl');
          width: 12px;
          height: 12px;
          display: inline-block;
          background-repeat: no-repeat; //画像をリピートしない
          background-size: contain; //画像の縦横比を崩さず範囲いっぱいの大きさにする
          margin-left: 10px;
        }

background-imageでsvg画像を指定する。

大きさを変えなくていい

        &::after {
          content:  url('svgのurl');
        }

ならcontentにそのままurlを指定することでsvgアイコンを疑似要素に指定できる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?