LoginSignup
0
1

More than 3 years have passed since last update.

herokuにデプロイした際にCSSで指定した画像が表示されない

Posted at

backgroundで指定した画像が消えてる!?

Googleで検索しても・・・中々望んでる解答がない。

[そこで検索してるうちにようやく見つけた解決策]

CSS
.xxx {
background-image: url("heart.png");
}

これだと、デプロイしても画像は表示されません。
上手く画像を見つけ出してくれないらしいです。

.xxx {
background-image: image-url("heart.png");
}

image-urlとすることで、app/assets/images配下から画像を探してくれる。
との事で試した結果。すんなりと直りました。

という事で、今回のメモでした。

0
1
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
1