solved Image URL in css

sekeri
sekeri
@ilker
9 years ago
334 posts
I have cloned the Slate skin as mgMySlate and now want to have a background image for the menu. This is the relevant lines in jrMenu.css file.

#jrmenu_content {
    background:#FFFFFF  url("{$mgMySlate_img_url}/menu-bg.png");
    padding: 0;  /* @ignore */
    clear: left;
}

When I inspect the page I see that I have the image url as;

http://www.mywebsite.com/data/cache/mgMySlate/img/menu-bg.png

But it does not work. Any help on this? Thanks..

By the way, I can reach the image using the link http://www.mywebsite.com/skins/mgMySlate/img/menu-bg.png
updated by @ilker: 06/13/15 02:48:29AM
sekeri
sekeri
@ilker
9 years ago
334 posts
The line below generates exactly the same url

http://www.mywebsite.com/skins/mgMySlate/img/menu-bg.png

but does not work neither.

   
 background:#FFFFFF  url("{jrCore_image image="menu-bg.png"}");
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Try sperating the css elements

ie
background-image: url("{jrCore_image image="menu-bg.png"}");
background-color: #FFFFFF
sekeri
sekeri
@ilker
9 years ago
334 posts
Really really strange;

The css below generates the correct url now.
#jrmenu_content {
    background:#000000 url("{$mgMySlate_img_url}/menu-bg.png");
    padding: 0;  /* @ignore */
    clear: left;
}

http://www.mywebsite.com/image/img/skin/mgMySlate/menu-bg.png
douglas
@douglas
9 years ago
2,793 posts
I'm not sure if you pasted the code from your first post or not, but there is an extra space in this line:

background:#FFFFFF  url("{$mgMySlate_img_url}/menu-bg.png");

between the color code and url, that will cause it to not work.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

Tags