Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-11 12:18:12

t0ma
Member
From: On the edge of arctic circle
Registered: 2005-04-28
Posts: 24
Website

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

  1. What is the absolute path to your image?
  2. Are you able to load that URL up in all three browsers?

Offline

#3 2007-01-11 13:01:14

t0ma
Member
From: On the edge of arctic circle
Registered: 2005-04-28
Posts: 24
Website

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

#4 2007-01-11 14:55:04

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

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

#5 2015-02-26 08:39:22

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

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

Board footer

Powered by FluxBB