【发布时间】:2016-01-11 22:55:37
【问题描述】:
我正在尝试创建一个受 IE8+ 支持的页面。
我需要页面有一个 100% 宽度的页眉和页脚。
在左侧,我需要有一个“高度为 100%”的菜单。在菜单的右侧,我需要放置一个 iframe,它需要占据布局中心的全宽、全高。
这是我到目前为止所做的事情
<div class="container-fluid container-fluid-override">
<div class="b_header" >
HEADER
</div>
<div class="bodyBlock">
<div class="left_menu">LEFT MENU</div>
<div class="right_menu">iFrame should go here</div>
</div>
<div class="b_footer">
Footer
</div>
这是我的css代码
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
.container-fluid-override
{
height: 100%;
margin: 0;
padding: 0;
}
.bodyBlock {
height: 100% !important;
display: inline-block;
}
.left_menu {
background-color: orange;
display: inline-block;
width: 140px;
height: 100%;
}
.right_menu {
display: inline-block;
width: calc(100% - 140);
height: 100%;
}
iframe {
box-sizing: border-box;
height: 100vh;
}
.b_header {
width: 100%;
height: 75px;
padding: 10px;
background-color: blue;
text-align: center;
color: white;
font-weight: bold;
box-sizing: border-box;
left: 0;
top: 0;
}
.b_footer {
width: 100%;
height: 50px;
padding: 10px;
background-color: purple;
text-align: center;
color: #ffffff;
font-weight: bold;
box-sizing: border-box;
left: 0;
bottom: 0;
}
我用我的代码http://jsfiddle.net/qgaLtbgg/7/创建jFiddle
我的布局的问题是,如果我删除文本“iFrame 应该放在此处”,页面中间就会消失。
另外,当我尝试将 iframe 放在中间框架时,左侧菜单消失了。
我该如何解决这个问题?
【问题讨论】: