Images in CSS Stylesheet

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Images in CSS Stylesheet

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Images in CSS Stylesheet

Post 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?
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Images in CSS Stylesheet

Post by danst0 »

Yes indeed.

Ok, then "my way" is still the correct one, there is no way of using some variable for that?
Daniel
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Images in CSS Stylesheet

Post by Don Chambers »

try this:
background-image: url('{TEMPLATE_PATH}img/titlebg.jpg');
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Images in CSS Stylesheet

Post by danst0 »

Works like a charm!

Thanks!
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Images in CSS Stylesheet

Post by Don Chambers »

Happy to help! :wink:
=Don=
Post Reply