引用资产供应商目录中的图像 url

referencing image url in asset vendor directory

当 css 文件在 vendor/assets/stylesheets 目录中时,如何引用 background image url?查看 SO 个帖子后

background: url(myimage.png) repeat-x;

background: asset-url('myimage.png'image) repeat-x;

但其中 none 有效

你应该试试

background: url("/assets/ion/myimage.png") repeat-x;

将您的图片放入 app/vendor/assets/images/myimage.png

#research_sign {
background: url("myimage.png") repeat-x;
}

    #Important: don't forget to restart your server!
     (as you added image inside your vendor/images)

试试这个文件路径

 background-image: url("../../assets/ion/myimage.png") repeat-x;