如何把DIV放在FRAMESET上?(How to put DIV over FRAMESET?)

编程入门 行业动态 更新时间:2024-10-26 02:36:00
如何把DIV放在FRAMESET上?(How to put DIV over FRAMESET?)

我想在我的框架集上绘制DIV图层。 我听说DIV可以放在<frameset>里面,但它对我不起作用。

以下示例不起作用。 我甚至没有在Firebug HTML-inspector中看到DIV。

<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Test of frameset with div</title> <style type="text/css"> #flashContent { position:fixed; left:200px; bottom:200px; width:400px; height:400px; background-color:red; z-order:1000; } </style> </head> <frameset rows="*,100px" style="z-order:10"> <frame src="content1.html"> <frame src="bottom.html"> <div id="flashContent"> Something </div> </frameset> </html>

I want to have DIV layer drawn over my frameset. I heard that DIVs can be placed inside <frameset> but it does not work for me.

The following example does not work. I don't even see DIV in Firebug HTML-inspector.

<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Test of frameset with div</title> <style type="text/css"> #flashContent { position:fixed; left:200px; bottom:200px; width:400px; height:400px; background-color:red; z-order:1000; } </style> </head> <frameset rows="*,100px" style="z-order:10"> <frame src="content1.html"> <frame src="bottom.html"> <div id="flashContent"> Something </div> </frameset> </html>

最满意答案

您不能将DIVs放在framesets之上。 唯一的方法是将您的DIV放在iFrame 。 至少对于较新的浏览器( 没有IE6 )。

根据您的代码示例,您必须绝对定位您的DIV包括z-index属性:

#flashContent { position: absolute; left: 200px; bottom: 200px; z-index: 2; width:400px; height:400px; background-color:red; }

You cannot position DIVs on top of framesets. The only way to achieve is to position your DIV over an iFrame. At least for newer browsers (no IE6).

As per your code example you have to position your DIV absolutely including the z-index property:

#flashContent { position: absolute; left: 200px; bottom: 200px; z-index: 2; width:400px; height:400px; background-color:red; }

更多推荐

本文发布于:2023-07-26 17:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1278493.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:放在   DIV   put   FRAMESET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!