来自iframe本身的iframe上的Div [英] Div over iframe that is from iframe itself

查看:81
本文介绍了来自iframe本身的iframe上的Div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个div,该div包含在来自外部html的iframe中

I have a div that is contain inside an iframe from a external html

<iframe src="test.html">

基于html的上下文菜单"需要位于iframe的顶部,但是上下文菜单的html代码位于iframe本身中.首选纯CSS解决方案.

The html based "context menu" need to be on top of the iframe but the html code of the context menu is in the iframe itself. A pure CSS solution is preferred.

推荐答案

iframe的内容无法在iframe外部显示.在iframe中,您可以使用"position:absolute"和"z-index:1000"(或另一个适当的大数字)使div出现在其他元素上.请注意,绝对定位的元素已从文档流中删除.可以使用CSS的顶部",左侧",右侧"和底部"属性来设置位置.

The contents of an iframe cannot be displayed outside of the iframe. Within the iframe, you can have the div appear over other elements using "position: absolute" and "z-index: 1000" (or another appropriately large number). Note that absolutely positioned elements are removed from the flow of the document. The position can be set using the "top", "left", "right", and "bottom" CSS properties.

这篇关于来自iframe本身的iframe上的Div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆