开发者

IE 7 or 8 Continuously Attempts to Load Background Image

开发者 https://www.devze.com 2023-01-13 16:47 出处:网络
I\'ve only seen this happen when testing in IE 7 or 8 from a Windows Server 2008 R2 box. I\'ve tested on Windows 7 and it works fine. Other browsers are fine.

I've only seen this happen when testing in IE 7 or 8 from a Windows Server 2008 R2 box. I've tested on Windows 7 and it works fine. Other browsers are fine.

So I have a very simple bare bones test page with a link to an external stylesheet that sets a background image on the body (could be a div too). If there is a ul, ol or table tag within the page IE fails to load the background image and continuously tries to load it. So you will see the "downloading" message in the status bar and see the blu开发者_高级运维e circular load image in the tab. Also, this will only happen if the image is already in the cache and IE doesn't make a conditional request for the image. I've coincidentally seen this happen on the httpwatch site while going there to get their tool to help me solve this issue. Kind of funny. But here's an example of a page:

<html>
<head>
    <title></title>
    <link type="text/css" rel="stylesheet" href="/base_css/ietest.css" />
</head>
<body>
    <ul><li>hi</li></ul>
</body>
</html>

stylesheet:

body 
{
    background: url(/images/yourimage.gif);
}

Its fairly consistent on load of the page or if you open a new tab and paste in the url. If you refresh the page it works fine but when you invoke a refresh you are making a conditional request. So I don't know if its some weird IE,css,rendering issue or there's a problem with IE trying to grab an image directly from the cache without making any requests for it. And the ul,ol,table condition is bizarre and makes me wonder about my sanity.

Thanks for any help on this. I know it's a fringe case.


Okay i dont really know what your looking for your question is a bit complicated for my english, but one thing is that your css is wrong:

Your css:
   body 
    {
        background: url(/images/yourimage.gif);
    }

remember '' like this

body 
{
    background: url('/images/yourimage.gif');
}
0

精彩评论

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