css - 如何将 DIV 置于 FRAMESET 之上?

标签 css html html-frames

我想在我的框架集上绘制 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>

最佳答案

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

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

#flashContent {

  position: absolute;
  left: 200px;
  bottom: 200px;
  z-index: 2;

  width:400px; 
  height:400px; 
  background-color:red;
}

关于css - 如何将 DIV 置于 FRAMESET 之上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9047178/

相关文章:

css - 使用 CSS 将 float <div> 向下推,而不是在其上方的另一个 float 旁边

html - 将表格宽度设置为 100% 不会填充区域

html - 允许图像覆盖屏幕上所有内容的 CSS 动画

html - 如何在html中的标题框架上设置搜索输入框

jQuery 工具 : making the tab pane height changeable

javascript - jQuery [data-anchor] 似乎出现故障

javascript - HTML 框架的 onload 在内容加载之前调用

javascript - 高度为 100% 的全屏 iframe

html - 带边框的 HTML 元素的偏移 anchor 以针对固定标题进行调整

html - Bootstrap 4 的新手,列没有按应有的方式运行?