【发布时间】:2017-10-27 21:05:46
【问题描述】:
我有一个带有 div 和 css 的 html 文档,如下所示:
<html>
<head>
<title></title>
<style text="text/javascript">
body { padding:0px; margin:0px; }
.full { background-color: yellowgreen; width: 100%; height: 100%; }
.menu { height: 50px; width: 100%; background-color: black; position: fixed; }
.behindMenu { height: 50px; width: 100%; }
.logo {width: 100%; height: 150px;}
.content {background-color: yellow;}
</style>
</head>
<body>
<div class="menu">Menu</div>
<div class="behindMenu"></div>
<div class="logo">Logo</div>
<div class="full">Full div</div>
<div class="content">The rest content</div>
</body>
</html>
Menu 是固定的,beforeMenu 和 Menu 大小一样,在 menu 后面。然后我有徽标和 div 类已满。完整之后是带有类内容的div。
当访问该页面时,我希望该 div full 将(大小)介于徽标和底部 od 浏览器大小之间。因此,即使我调整窗口大小,完整的徽标和浏览器大小的底部也必须有一个高度。向下滚动时,用户将看到其余内容。
类似这样的:http://strobedigital.com/
这里是小提琴:http://jsfiddle.net/2963C/
【问题讨论】: