开发者

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)开发者_StackOverflow中文版

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 ??


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.


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


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).


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

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

hope this helps


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜