다음은 내 페이지 레이아웃을 작성한 코드입니다. 문제는 이것이 모두 정적으로 정의 된 것입니다. 제가 원했던 것은 동적 인 것입니다. 즉,보기에 사용되는 브라우저의 크기에 따라 크기가 변경됩니다. 모든 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
당신은 절대적으로 (거의) 모든 (신체의) 자식 요소를 포지션하고 있습니다, 이것은 나쁜 나쁜 것입니다 : (바로 지금, 당신의'
'요소는'# toolbar' 요소만을 포함하고 있습니다. .이 템플릿을 상대 위치 지정으로 다시 실행해야합니다. – Kraz