0
Slashpage高度:100%自动缩放DIV元素,并考虑到页眉和页脚,直到滚动
我试图做一个醒目,将填补屏幕,但考虑到页眉和页脚的大小。页脚和页眉不是固定位置,但当页脚到达顶部时,页脚会变粘:0;所有听起来都不错,直到我实际上试图让启动屏幕在多个设备上运行,我尝试过CSS媒体查询,但相信我实际上需要一个JavaScript来监视首次访问页面时浏览器高度的变化。 注意:我看过How to make the web page height to fit screen height,但似乎没有提到滚动的可能性。
HTML:
<nav class="top-menu">
<ul>
<li>Top Button 1</li>
<li>Top Button 2</li>
<li>Top Button 3</li>
<ul>
</div>
<div class="splashpage">
</div>
<nav class="bottom-menu">
<ul>
<li>Bottom Button 1</li>
<li>Bottom Button 2</li>
<li>Bottom Button 3</li>
<ul>
</div>
<div class="the-rest-of-the-page">
</div>
CSS
.top-menu{width:100%;height:40px;}
.bottom-menu{width:100%;height:40px;}
.splashpage{height:100%;height:100%;}
.the-rest-of-the-page{width:100%;}
那么醒目网页应该可以解决屏幕除了顶部和底部栏,然后用户就可以向下滚动,查看页面的其余部分。下面是一张图片来展示我的意思。