我有 Rails 3.2.9,我想放一张背景图片。我的图像位于文件夹中:public/images
,我也将它放在文件夹中:assets/images
。
ul {
height: 200px;
width: 350px;
border: solid 1px blue;
margin: 0 auto;
padding: 0px;
background-image: url('/images/todo.png');
}
但是没有背景图。 请帮忙。
最佳答案
我必须把:
background-position: center;
所以我的代码是:
background: url(/assets/rsz_todo.png) no-repeat;
background-position: center;
我的图片在 assets/images
中找到
关于css - rails 中的背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14435141/