Katia
Katia

Reputation: 729

background image

I have this html line

<body style ="background-color : pink;background-image : url('.\img\summer.jpg') ;" >

it works on IE8 but not firefox ,opera, google chrome or apple safari (only color shows)

I read many post with about this and tried all the solution still not working

on the other hand , if I stick to IE8

<table style="position:fixed; left:25px; top:250px;" border=1> doesn't work , though it works on all the other browsers , see my problem .. I need to use bg image and fixed position together

any ideas ??

Upvotes: 0

Views: 347

Answers (5)

oezi
oezi

Reputation: 51797

the IE 6 and below doesn't know position:fixed, but there are a lot of workaround (als google fore "IE position fixed") - this is just one of them i used some time ago.

to the background-image: i think the main problem here is using backslashes ( \ ) instead of "normal" slashes ( / ) - change that and i will work in other browsers, too.

Upvotes: 0

rashmi
rashmi

Reputation: 619

<body background ="someimg.jpg" bgcolor="#33333" >

this should work. i have tested in chrome and it is working fine for me.

hope this helps

Upvotes: 0

user644602
user644602

Reputation: 44

<body style="background:pink url(img/summer.jpg);">

Upvotes: 2

madd0
madd0

Reputation: 9323

Concerning your background image, first use forward slashes in the URL that you are using, e.g. ./img/summer.jpg.

Second, remember that the URL of the image is relative to the file where the CSS is located (in this case, the HTML file).

Upvotes: 1

Pekka
Pekka

Reputation: 449435

Try replacing the \ with /.

Forward slashes are the standard directory separator in HTML pages, and servers won't recognize backslashes. I guess IE converts them into forward slashes automatically.

Upvotes: 2

Related Questions