问题描述:

The background image doesn't appear in IE8, but it works fine in all browsers, including IE9

Relevant CSS:

 #player {

background: url('/images/tv-screen.jpg') center top repeat-x;

padding: 25px 26px 0 -1px;

width: 660px;

height: 403px;

border: #555 solid 1px;

margin-top: 0;

margin-bottom: 0;

}

Relevant HTML:

 <p id="player">...//some data ..</p>

网友答案:

The CSS looks okay.

I think IE8 fails on the tag itself: <p id="player>. The id attribute doesn't have a closing ". If this causes the id to be misinterpreted, the CSS selector will not match it.

网友答案:

the problem is : there is iframe inside iframe which blocking the background I don't know why , even I make the two iframe with wmode=transparent.

so I created a background in last iframe by js in IE less than 9 only.

thanks guys for your time .

网友答案:

are you using the correct DOCTYPE ?

http://www.w3.org/QA/2002/04/valid-dtd-list.html

网友答案:

Have you tried removing the negative padding that you have set. This can cause issues in ie7/8.

相关阅读:
Top