我已經看過這個問題已經提出的爲重複:拉伸格至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