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.

【CSS】SVGを擬似要素で使う

Last updated at Posted at 2023-11-22
test.css
div::before {
    content: "";
	background-image: url("xxx.svg");
    background-size: 50px;
    filter: invert(45%) sepia(85%) saturate(2448%) hue-rotate(163deg) brightness(97%) contrast(103%);
}
  • background-image: url() でSVGファイルを指定
  • background-size: で大きさを指定
  • filter: で色を指定
    https://codepen.io/sosuke/pen/Pjoqqp でカラーコードをfilterで使う値に変換できる
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?