【问题标题】:need help using div and iframe需要帮助使用 div 和 iframe
【发布时间】:2013-09-27 21:29:40
【问题描述】:

我创建了一个小网站(可能会保持离线状态)以使某些事情变得更容易。我创建了一个带有链接的快捷栏,以便我可以更轻松地导航到重要网站。

问题是:

要将 iframe google 到网页中,我必须使用代理(我使用 hidemyass),因为 google 阻止使用 iframe,但是因为代理站点在您通过它打开的每个页面顶部都有一个巨大的横幅,所以我移动了内容在 iframe 内部使用 CSS 中的顶部边距。

所以横幅仍然存在,但你看不到它,但现在每当我在同一个 iframe 中打开任何其他没有任何横幅的网站时,它都会隐藏网站的一部分,我不希望这样。

那么我如何让它隐藏代理页面顶部的横幅并仍然完全显示任何其他页面?我试图给 div 和 iframe 2 命名,以便我可以制作 2 个 CSS 语句,但这不起作用。 代码如下:

#frame1 {
    position:fixed !important;
    position:absolute;
    top:0%;
    right:0%;
    bottom:0%;
    left:8%;
    overflow: hidden;
}

body {
background-color: black
}

#frame2 {
width: 100%;
height: 131%;
    margin-top: -18.5%;
}


<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="school/bronnen/css/main.css">
<meta charset="UTF-8">
<title>Bronnen</title>
</head>
<body>
    <br>
a href="http://2.hidemyass.com/ip-1/encoded/czovL3d3dy5nb29nbGUuY29tLw%3D%3D" target="frame2"><img src="school/bronnen/pics/google.jpg" alt="google" width="7%" height="auto"></a>
<br>
<a href="http://1.hidemyass.com/ip-5/encoded/czovL2dpdGh1Yi5jb20v" target="frame2"><img src="school/bronnen/pics/github.png" alt="github" width="7%" height="auto"></a>
<br>
<a href="http://www.awwwards.com" target="frame2"><img src="school/bronnen/pics/awwards.png" alt="awwards" width="7%" height="auto"></a>
<br>
<a href="https://7.hidemyass.com/ip-1/encoded/czovL3d3dy5kcm9wYm94LmNvbS8%3D" target="frame2"><img src="school/bronnen/pics/dropbox.jpg" alt="dropbox" width="7%" height="auto"></a>
<br>
<a href="http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/the-best-way-to-learn-css-2/" target="frame2"><img src="school/bronnen/pics/activetuts.png" alt="activetuts" width="7%" height="auto"></a>
<br>
<a href="https://7.hidemyass.com/ip-1/encoded/Oi8vc3RhY2tvdmVyZmxvdy5jb20v" target="frame2"><img src="school/bronnen/pics/stackoverflow.jpg" alt="stackoverflow" width="7%" height="auto"></a>
<div name="frame1" id="frame1"><iframe src="school/bronnen/iframe/iframe.html" name="frame2" id="frame2" frameborder="1" scrolling="auto"></iframe></div>
<br>
<a href="http://player.highstrike.org/play/" target="frame2"><img src="school/bronnen/pics/dubstep.jpg" alt="dubstep" width="7%" height="auto"></a>
<br>
<a href="http://www.codecademy.com/learn" target="frame2"><img src="school/bronnen/pics/codecademy.png" width="7%" height="auto" alt=""></a>
<br>
<a href="http://www.youtube.nl" target="frame2"><img src="school/bronnen/pics/youtube.png" alt="youtube" width="7%" height="auto"></a>
<br>
<a href="http://www.facebook.com" target="frame2"><img src="school/bronnen/pics/facebook.png" alt="facebook" width="7%" height="auto"></a>
<br>
<a href="http://tpb.peterbishop.net/" target="frame2"><img src="school/bronnen/pics/piratebay.jpg" alt="piratebay" width="7%" height="auto"></a>
<br>
<a href="http://www.twitter.com" target="frame2"><img src="school/bronnen/pics/twitter.png" alt="twitter" width="7%" height="auto"></a>
</table>

【问题讨论】:

    标签: css html iframe


    【解决方案1】:

    出于明显的安全原因,您不能从其父级更改 iframe 的内容

    【讨论】:

      猜你喜欢
      • 2021-03-30
      • 1970-01-01
      • 2011-10-17
      • 1970-01-01
      • 1970-01-01
      • 2014-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多