Page 1 of 1

Images in CSS Stylesheet

Posted: Wed May 18, 2011 4:39 pm
by danst0
Hi,

just a short question: In my own stylesheet I have to refer to pictures as

Code: Select all

background-image: url(templates/myTemplate/img/titlebg.jpg);
else the picture is not found, but in the bulletproof it is refered to as

Code: Select all

background-image: url(img/titlebg.jpg);
.

Why? What is the right way to do it?
Daniel

Re: Images in CSS Stylesheet

Posted: Wed May 18, 2011 4:49 pm
by Don Chambers
Yours are probably in the stylesheet style.css, whereas the bulletproof images are in a secondary stylesheet.... such as a colorset stylesheet. Is that the case?

Re: Images in CSS Stylesheet

Posted: Wed May 18, 2011 4:56 pm
by danst0
Yes indeed.

Ok, then "my way" is still the correct one, there is no way of using some variable for that?
Daniel

Re: Images in CSS Stylesheet

Posted: Wed May 18, 2011 5:04 pm
by Don Chambers
try this:
background-image: url('{TEMPLATE_PATH}img/titlebg.jpg');

Re: Images in CSS Stylesheet

Posted: Wed May 18, 2011 5:18 pm
by danst0
Works like a charm!

Thanks!

Re: Images in CSS Stylesheet

Posted: Wed May 18, 2011 5:23 pm
by Don Chambers
Happy to help! :wink: