Rails Rails 中背景图片没显示

maxchen · January 19, 2018 · Last by tianlitao replied at January 22, 2018 · 1762 hits

问题是这样的: 我在 app/assets/images 下新建了一个文件夹 website; 然后在这个文件夹下放了两张照片:logo3.png 和 background3.jpg; 然后我在××.html.erb 中通过 image_tag("website/logo3.png", width:80) 实现没问题; 但在××.css 文件中通过 background: url("website/background3.jpg") 0 / cover;实现背景图片却在生产环境中失败了,但在开发环境中是正场的。 请问各位知道问题出在哪吗?

Reply to Peter

打不开、、、 应该不是网络的问题,因为我同时打爱奇艺都能正常看视频。

得编译

Reply to zouyu

我部署的时候编译过了

invoke :'rails:assets_precompile'

问题是我能在 html 中直接使用图片,但图片用作背景图片就不行。

Reply to Rei

搞定了,谢谢谢谢您😊 ,能帮我再看下昨天问您的关于邮件的问题吗?

Reply to maxchen

爱奇艺能打开,不代表不是网络的问题。。应该是墙吧,我这里可以正常打开。

Reply to tianlitao

有可能,你这是在国外吗

maxchen closed this topic. 04 Feb 15:41
You need to Sign in before reply, if you don't have an account, please Sign up first.