English 中文(简体)
页: 1 1. 空间
原标题:make DIV take all lower space
  • 时间:2012-04-25 08:22:10
  •  标签:
  • html
  • css

例如:

<header>Hello</header>
<div role="main">Body</div>
<footer>&copy;</footer>

header {
    height:20px;
    background: #edf1f5;
}
div {
    background:#ddd;
    padding:20px;
}
footer {
    background: #e4e8ec;
}​

您如何做<条码>脚印>。 占用所有剩余空间? 我无意在这里有一只 stick脚步,我只是想方设法填补这一空间。


http://jsfiddle.net/XF3E7/“rel=“nofollow” http://jsfiddle.net/XF3E7/。

最佳回答
问题回答

I ve always used a work around for this. If you make the body background colour the same as the footer it creates the illusion of it extending down the page. http://jsfiddle.net/ollie/q3xzh/1/

header {
height:20px;
background: #edf1f5;
}
div {
background:#ddd;
padding:20px;
}
footer {
background: #e4e8ec;
}
body {background:#e4e8ec;}

我猜想你们想要的是这样的东西? 。 http://jsfiddle.net/Ralt/XF3E7/5/

但是,没有施舍? 如果没有 j印或使用表格是不可能的。

确实,我建议使用背景颜色作为@Ollie的话。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签