gpt4 book ai didi

html - 我如何拥有静态高度/宽度侧边栏和底部栏以及包含 iframe 的响应式主要内容区域?

转载 作者:行者123 更新时间:2023-11-28 18:19:52 25 4
gpt4 key购买 nike

我想显示一个网页,它只是一个 iframe,具有固定宽度的边栏和固定高度的底栏。

它看起来像这样:enter image description here

这是我现在所在的位置,这是行不通的:

<style>
body {margin:0;overflow:hidden;background-color:#f4f4f4;}
#iframe {position:absolute;left:0px;top:0px; width:100%; height:100%; padding:0px 200px 100px 0px;}
#bars {width:100%;height:100%;}
#bottombar {width:100%; height: 100px; position: absolute; bottom: 0; background: grey}
#sidebar {width:200px; height: 100%; position: absolute; right: 0;background: grey}
</style>


<iframe id="iframe" name="iframe1" frameborder="0" height="100%" width="100%" src="http://someurl.com"></iframe>

<div id="bars">
<div id="bottombar"></div>
<div id="sidebar"></div>
</div>

如有任何帮助,我们将不胜感激!

最佳答案

我会使用 HTML5,这不是制作布局的最佳方式,但是......

这是 jsfiddle:http://jsfiddle.net/JP3zW/

/* In a Reset CSS */

body, div {
margin: 0;
padding: 0;
}

/* Style CSS */

html, body { height: 100%; }

body {
position: relative;
background: #F4F4F4;
}

iframe#iframe {
width: calc(100% - 200px);
height: calc(100% - 100px);
overflow: hidden;
}

div#sidebar {
position: fixed;
top: 0;
right: 0;
height: 100%;
width: 200px;
background: gray;
}

div#bottombar {
bottom: 0;
height: 100px;
width: 100%;
background: black;
}

关于html - 我如何拥有静态高度/宽度侧边栏和底部栏以及包含 iframe 的响应式主要内容区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17203085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com