Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
css problem: image not working in body and div background
I am moving site from my WAMP environment to my customers host provider and I have weird problem.
I have designed site and got it working perfectly with IE6, Firefox1.0 and Opera9 and now I can´t get background images working with div and body tag when trying to put image as background.
body
{
background: url(/images/bg_image.jpg) repeat-x;
background-color: #921F21;
color: black;
margin:0;
padding:0;
}
In new server this works with Opera on my start page but not on content pages. IE and Firefox ignore this. Images as backgound in body and div tags seems not to load.
Hands up, I have no clue.
Oh, I tried to change path to
background: url("/images/bg_image.jpg") repeat-x;
and to
background: url("images/bg_image.jpg") repeat-x;
Any advice?
“The role of art is to make a world which can be inhabited.”
Offline
#2 2007-01-11 12:40:09
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: css problem: image not working in body and div background
- What is the absolute path to your image?
- Are you able to load that URL up in all three browsers?
Offline
Re: css problem: image not working in body and div background
Hi there and thanks for quick reply
1. http://mysite/newsite/images/image.jpg
2. I am able to load images with absolute path on all those browsers but can´t access them through css.
Now I double checked and all but one image load correctly (with same code) with absolute paths through css. Could this be come kind of server restriction? Image directories are chmodded correctly.
I have to double check everything else if nothing else comes up.
“The role of art is to make a world which can be inhabited.”
Offline
Re: css problem: image not working in body and div background
I would try a consolidated background css tag, or break it out like below… also i see you have a newsite directory, so is it possible that the newsite has the image and not the old site, and the ones that work are images that are in both places so url should be something like this /newsite/images/bg_image.jpg
.
body
{
background: #921F21 url(/images/bg_image.jpg) repeat-x 0 0;
margin:0;
padding:0;
}
OR
.
body
{
background-image: url(/images/bg_image.jpg);
background-color: #921F21;
background-repeat: repeat-x;
margin:0;
padding:0;
}
nuff-respec ::: dannyb
Offline
Re: css problem: image not working in body and div background
Maybe the problem is the absolute path.
You could try
body
{
background: url(/newsite/images/bg_image.jpg) repeat-x;
background-color: #921F21;
color: black;
margin:0;
padding:0;
}
Becouse if you check url(/images/bg_image.jpg) it search on http://mysite/images/
not in http://mysite/newsite/images/
Offline