2009-05-28 10 views
0

저는 3 열 웹 페이지 (왼쪽 네비게이션 위의 헤더 & 메뉴 막대, 아래쪽에 전체 너비 바닥 글이있는 메인 영역 및 오른쪽 사이드 바)을 구축 중입니다. 각 열에 배경색이 있지만 전체 열을 채우는 대신 텍스트 끝에 잘라냅니다. 테이블 (td) 사용에 의존하지 않는 전체 열을 채울 수있는 방법이 있습니까? 내가 스타일의 높이를 설정할 수 있습니다 알고css 전체 높이?

#container 
{ 
    float: left; 
    width: 100%; /* IE doubles the margins on floats, this takes care of the problem */ 
    display: inline; /* this is where Ryan Brill (author of the ALA's article) and I go in "opposite directions" */ 
    margin-left: -200px; 
} 
#left 
{ 
    float: left; 
    width: 180px; /* IE doubles the margins on floats, this takes care of the problem */ 
    display: inline; 
    margin-left: 200px; 
    padding: 0px 0px 0px 5px; 
    background: url('/App_Themes/Default/images/RightColumnBackground.png') repeat left top; 
} 
#main 
{ 
    /* the width from #left (180px) + the negative margin from #container (200px) */ 
    margin-left: 380px; 
    padding: 0px 0px 0px 5px; 
} 
#sidebar 
{ 
    /* this is to keep the content of #sidebar to the right of #main even if the content of "main is shorter */ 
    padding-left: 100%; /* this is to "bring back" the #sidebar that has been moved out of the viewport because of the padding value */ 
    margin-left: -220px; 
} 

하지만 픽셀의 특정 번호로 높이를 핀 :

다음은 일반적인 레이아웃에 대한 내 CSS입니다. height: fill; 유형 옵션이 있습니까?

답변

2

이것은 매우 일반적인 문제입니다. 좋은 접근법은 faux columns을 사용하는 것입니다.

1

현재 브라우저에서 광범위하게 지원되는 CSS에는 없지만 ways of approximating it이 있습니다.

+0

내 중심 열이 가변 폭이기 때문에이 방법이 내게 효과적이지 않을 것이라고 생각합니다 (슬라이딩 도어 기술을 수행하는 방법을 이해하지 않는 한). 어쩌면, 지금은 작은 테이블 사용이 내가 필요한 것을 할 것입니다. < sigh/> –