1

我发现了将 iframe 放在 iframe 之上的技术,以解决浏览器对 iframe 的 z-index 问题。

我现在面临的问题是我需要与 PDF 重叠的 iframe(加载到 iframe 中)是透明的。这可能吗??

我想这样做的原因是我可以在 PDF 的顶部有一个透明的 png

下面是一些代码,以便您可以看到我的问题 - 您将在 PDF 的左上角看到一个白色方块。

<!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></title>

    <style type="text/css">
        #contentFrame
        {
            height:500px;
            width:990px;
        }       

        #overlapFrame
        {
            width:100px;
            height:100px;
            position:absolute;
            left:0;
            top:0; 
            background: transparent;           
        }

    </style>

</head>
<body>
    <iframe src="http://www.education.gov.yk.ca/pdf/pdf-test.pdf" id="contentFrame" frameborder="0"></iframe>
    <iframe id="overlapFrame" frameborder="0" scrolling="no"></iframe>
</body>
</html>
4

0 回答 0