是否有可能使包装器填充窗口高度(没有滚动)和中心div可滚动而不会弄乱像素和JavaScript?
<div id="wrapper">
<h1>Header</h1>
<div id="center">
<div style="height:1000px">high content</div>
</div>
<div id="footer">Footer</div>
</div>
Run Code Online (Sandbox Code Playgroud)
基本上我希望标题在顶部可见,页脚始终在底部可见,并且在中心有一个可滚动的内容,占据了重新生成的高度.
页眉,页脚和中心div的高度都是未知的(没有设置px或%,即可变字体大小或填充).纯CSS可以吗?
我需要在底部保持一个页脚,但它的高度是可变的,所以主要的解决方案不适合我...
我不能做的例子:http : //www.cssstickyfooter.com/ http://matthewjamestaylor.com/blog/bottom-footer-demo.htm
任何人都有灵活的页脚解决方案?谢谢
我有一个div有两个嵌套的div.第一个孩子根据其内容有不同的高度,我希望第二个div高度是父母留下的任何东西.
<div style="height:500px;">
<div>Some Content Here</div>
<div>This div needs to take up the rest of the space of its parent</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
谢谢,〜在圣地亚哥
我有60页都有相同的页脚,包括在PHP中.内容量从300px到2000+不等.我不认为这是可能的,但如果我可以让页脚坐在浏览器窗口的底部,如果页面比窗口短,并且行为正常(推到底部),那将是很好的,否则,只用CSS.谢谢.
我正在编写一个网页,它应该在顶部有一个页眉,在底部有一个页脚,在右侧有一个侧栏。我无法将页脚置于页面底部。我不希望它是 position: fixed (那会很烦人),但我确实希望它在您一直向下滚动时出现在页面底部。(在不需要滚动的情况下,它应该出现在窗口的底部)
这是我正在使用的。可能有一个非常简单的修复,但我不知道它是什么。复制/粘贴这个,你会看到。
<html>
<head>
<style type="text/css">
body {
font-size: 200%;
}
#side {
position: absolute;
right: 0;
top: 0;
bottom: 0;
background-color: #0A0;
z-index: 100;
}
#header {
height: 40px;
position: absolute;
top: 0;
left: 0;
right: 0;
background-color: #A00;
z-index: 200;
}
#header_push {
clear: both;
height: 40px;
}
#footer {
height: 50px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #00A;
z-index: 150;
}
#footer_push {
clear: both;
height: 50px;
}
</style>
</head>
<body> …Run Code Online (Sandbox Code Playgroud) css ×5
html ×3
absolute ×1
css-position ×1
footer ×1
height ×1
javascript ×1
jquery ×1
scrollable ×1