Page 1 of 1

Background Image

Posted: Thu Apr 28, 2005 11:50 pm
by compu73rg33k
I want to use a background image for the main background. The code I put in the css was

Code: Select all

background: url(mainbg.gif) repeat; 
For some reason it doesn't display the background. The mainbg.gif file is in the /templates/new_theme/ folder.

Posted: Fri Apr 29, 2005 12:06 am
by Oliver
Please try it with

Code: Select all

    background: url("templates/new_theme/mainbg.gif") #e1e1e1 repeat-y center top;
- Oliver

Posted: Fri Apr 29, 2005 12:51 am
by nine-times
Instead, you might want to use:

Code: Select all

url({TEMPLATE_PATH}mainbg.gif)
Serendipity will recognize what directory the current template is in and automatically plug it in for the variable "{TEMPLATE_PATH}".

That way, if you end up wanting to rename your directory from "new_theme" to "old_theme", you won't have to go back and re-edit your CSS file.

fixed

Posted: Fri Apr 29, 2005 5:12 am
by compu73rg33k
It appears that the color was taking precidence over the image for some reason. The code I used was

Code: Select all

background: url("{TEMPLATE_PATH}/mainbg.gif") transparent repeat center top;