我使用Rails 2.3.5的工作,我有圖像,其中加入到名爲custom.css的CSS文件了public/images/圖片網址下的樣式表2.3
#cssmenu ul {
background: url(nav-bg.png) repeat-x 0px 4px;
height: 69px;
}
如何我可以讓這個閱讀裏面的公衆/圖像? 我都試過,但沒有奏效
#cssmenu ul {
background: url(<%= asset_path '/images/nav-bg.png' %>) repeat-x 0px 4px;
height: 69px;
}
也是這不起作用
#cssmenu ul {
background: url(<%= asset_path 'nav-bg.png' %>) repeat-x 0px 4px;
height: 69px;
}
有了資產路徑,你不應該在你的文件名之前需要'/ images /',對嗎? – kunalbhat
它不能正常工作,並且我更新了我的問題 –