Background image not showing [solved]

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
geediu
Forum Members
Forum Members
Posts: 17
Joined: Thu Jan 17, 2008 7:57 pm

Background image not showing [solved]

Post by geediu »

Hi,

I've created a template from my graphic designer who has given me the HTM and CSS and the images. When I view the page I created with the template, the background image doesn't show but when I hit the URL of the image directly it displays no problem and I am hoping someone could tell me why.

This is how the CSS was done:

.blok_header {
background: url("images/hdrbg.gif") repeat-x scroll center top transparent;
margin: 0;
padding: 0;
}

Thanks in advance for your help.

Geediu
Last edited by geediu on Tue Feb 08, 2011 9:11 am, edited 2 times in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Background image not showing

Post by Dr.CSS »

You are using the {cms_stylesheet} tag so you need either url([[root_url]]/uploads/bla/bla) or url(/uploads/bla/bla) and no need for the " " note the / in them...
geediu
Forum Members
Forum Members
Posts: 17
Joined: Thu Jan 17, 2008 7:57 pm

Re: Background image not showing [solved]

Post by geediu »

Thanks for the quick response.

Works now when I use:

.blok_header { margin:0; padding:0; background:url([[root_url]]/images/hdrbg.gif) top repeat-x; }

but not sure why only needed for this one, whereas I only have url(/images/blahblah.gif) for referencing other images in the CSS.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Background image not showing [solved]

Post by Dr.CSS »

If you clear your browser cache you most likely see that the image under the slider doesn't show, may I suggest you put your images in uploads and not in root/images folder like a flat file site, I put them in a uploads/nameoftemplate folder in uploads if they are going to be used in the template and uploads/images if used in page content or album/gallery...
Post Reply

Return to “Layout and Design (CSS & HTML)”