单击iframe并重定向到另一个网页

click on iframe and be redirected to another webpage?

本文关键字:另一个 网页 重定向 iframe 单击      更新时间:2023-09-26

我看到很多关于如何使iframe可点击的帖子,但我似乎无法让其中任何一个工作。

有没有人知道用户可以单击iframe并重定向到另一个网页的方法?

我在记事本中将其编写为 html(是的,原语,但我通常不编写 html 代码)

如果您正在谈论框架中的链接,则可能必须在anchor元素上使用target属性。

例如 <a href="www.somewhere.com" target="_parent">This will take the parent window</a>

示范

您可以将与 iframe 中的 iframe 完全一样大的透明 png 图像放入

 <a href="yourlink"><img id="transparent" src="transparent.png"></a>

并把它放在前面

 #transparent { 
 z-index:100;
 }

在 CSS 中如果您不想自己制作透明图像,只需下载任何大小的透明PNG,并在CSS中根据需要调整其高度和宽度