2013-10-17 62 views
0

我已經寫了一些代碼,其中div應該重疊IFrame。在Chrome中它的工作正常,在IE IFrame重疊div。以下是代碼。任何關於如何解決這個問題的想法,以便IE和Chrome都能正常工作?IE中的IFrame重疊div(在Chrome中正常工作)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <title>IFrame Div</title> 
    </head> 
    <body> 
     <div top="86px" left="5px" width="500px" height="500px" z-index="20000" style="width: 1000px; 
      border-color: red; height: 500px; position: absolute !important; border-color: red; 
      left: 5px; top: 86px; border-width: 5px; background-color: #E6E6E6; opacity: .8;"> 
     </div> 
     <iframe src="http://samplepdf.com/sample.pdf" height="700px" width="600px"></iframe> 
    </body> 
    </html> 

回答

0

給的iframe:z-index:-999;

或者你可以使用在線CSS:<iframe src="http://samplepdf.com/sample.pdf" height="700px" width="600px" style="z-index:-999;"></iframe>

+0

你的建議並沒有在IE瀏覽器。 – Shrinivas

+0

嘗試在div'z-index:999;'看看是否有幫助 – SaturnsEye

+0

正確的z-索引再次它沒有工作。 – Shrinivas

相關問題