【发布时间】:2016-09-27 11:33:00
【问题描述】:
我想通过 CSS background: url() 属性设置背景图像。但它不起作用。没有什么特别的。我已经完成了:
-rails new myApp
-rails g controller Welcome index.
就是这样。我有这个 div:
<div class="image">
它的 CSS 是:
.image{
background: url('image.jgp');
}
我的资产/图像文件夹中有 image.jgp。我可以做<%= image_tag('assets/image.jgp') 并且它有效。但是 CSS 部分不起作用。
这个问题怎么解决?
【问题讨论】:
-
图片文件名不应该以
.jpg而不是.jgp结尾吗?
标签: jquery html css ruby-on-rails