ここでは、自分のページをレイアウトするためのコードを示します。問題は、これはすべて静的に定義されていることです。私が望むのは、これを動的にすることです。つまり、閲覧に使用するブラウザのサイズに基づいてサイズを変更します。私はdivのすべてが特定のページ・ディメンションのサイズに固定できると確信しています。メニューとコンテンツペインは、フィットするように調整されたdivでなければなりません。コンテンツdivは必要に応じてスクロール可能です。この表スタイルのレイアウトのCSSまたはjQuery
CSSでこれを行うことができますか、またはjQueryを必要とすることができますか?それとももっと良い方法がありますか?
おかげで、 エリック
<!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></title>
<style>
html, body
{
margin: 0;
padding: 0;
}
#container
{
}
#toolbar
{
background-color: Gray;
width: 100%;
}
#PageDescription
{
position: absolute;
background-color: Purple;
width: 100%;
text-align: center;
}
#RestOfPage
{
position: absolute;
background-color: White;
top: 82px;
height: 905px;
width: 1800px;
}
#Footer
{
position: absolute;
top: 987px;
left: 0;
background-color: Yellow;
width: 100%;
height: 30px;
}
#LeftPane
{
position: inherit;
width: 120px;
background-color: Lime;
height: 100%;
}
#RightPane
{
position: inherit;
width: 100%;
background-color: Silver;
left: 120px;
height: 100%;
}
</style>
</head>
<body>
<div id="toolbar">
<label for="Category">Category: </label><select id="Category"></select>
</div>
<div id="Footer"></div>
<div id="PageDescription">
<h1>Page Description</h1>
</div>
<div id="RestOfPage">
<div id="LeftPane">Menu</div>
<div id="RightPane">Content Content Content</div>
</div>
</body>
</html>
[http://jsfiddle.net/QwAGV/](http://jsfiddle.net/QwAGV/)で再生します。 – Andrew
あなたは(ほとんどの)すべての(子の)子要素を絶対的にpositonningしていますが、これは悪い悪いことです:(今、あなたの '
'要素は '#toolbar'要素のみを含んでいます。 – Kraz