我已经看过这个问题已经提出的为重复:拉伸格至100%页面长度
然而,从2008年的,是相当老了。我宁愿不使用Javascript或表来解决这个问题,如果可能的话,宁愿选择CSS解决方案。
下面是容器的div代码直至并包括左手导航:
/* Header Wrapper */
#header-wrapper {width:100%;height:120px;margin:0 auto;background:transparent url(/images/Structure/blue-transparent-repeat2.png);background-position:50% 50%;}
#clouds {height:120px;width:100%;margin:0 auto;background:transparent url(/images/Structure/clouds.png) repeat-x;background-position:50% 50%;}
#opaque {width:100%;margin:0 auto;height:120px;background:transparent url(/images/Structure/white-transparent.png);}
#header-content {margin:0 auto;position:relative;width:100%;max-width:1280px;height:85px;}
/* Content Wrapper */
#content-wrapper {float:left;background:url("/images/cream.jpg") repeat-x;width:100%;}
#shell {height:100%;width:100%;background:#fffef8 url("/images/Structure/signpost.gif") 5% 100% no-repeat}
/* Page Content Wrapper */
#page-outer{height:100%;margin:0 auto;padding:0 0.5% 8px;max-width:1280px;}
#page-content {height:100%;clear:both;margin:0 0.7%;}
/* Left Nav */
#left-nav {padding-top:7px;border-right:1px solid #ede9e8;float:left;width:20%;margin:0 0 110px 0;background:url(/images/header-repeat-left.png) repeat-y;background-position:right top;}
而这里展示的主要内容div的简化页面代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Inside <%=server.HTMLEncode(Session("PublicFranchiseName"))%> Business Directory and Local Guide – Your Inside Guide to <%=server.HTMLEncode(Session("PublicFranchiseName"))%></title>
</head>
<body class="home">
<div id="header-wrapper">
<div id="clouds">
<div id="opaque">
<div id="header-content"></div>
<div class="menu2"></div>
</div>
</div>
</div>
<div id="content-wrapper">
<div id="shell">
<div id="page-outer" class="clearfix">
<div id="page-content" class="clearfix">
<!--Start Left Nav-->
<div id="left-nav">
你已经问了这个两次,其他问题被关闭作为愚蠢:http://stackoverflow.com/questions/90178/make-a-div-fill-the-remaining屏幕空间。如果你想让这个问题保持开放,那么你需要解释为什么上述问题对你的问题没有帮助。谢谢。 – Kev
好的,我已经编辑了你的问题。 – Kev
下一次,编辑您的原始问题,如果它被关闭为dupe然后标记一个mod并解释您为什么不同意。不要一直发布相同的问题,这样会导致降价和帐户暂停。值得花一些时间阅读:http://meta.stackexchange.com/questions/7931/faq-for-stack-exchange-sites。我已经将以前的问题解答合并到了这个问题中。谢谢。 – Kev