2009-08-13 3 views
2

3 행 1 열 사이트 디자인이 있고 나머지는 열의 크기에 맞추기 위해 크기가 div로 조정되도록하고 싶습니다. 화면 - (하드 코드 된 푸터 높이 + 하드 코드 된 헤더 높이)). CSS로 이것을 할 수있는 귀여운 방법이 있습니까? 그렇지 않다면 어떻게 자바 스크립트로 이것을 할 수 있습니까?동적으로 사용자의 모니터의 크기/해상도에 따라 div의 크기 조정

감사합니다,

#container { 
    background-color: gray; 
    height: 100%; 
} 
#centercolumn { 
    background-color: white; 
    margin-left: auto; 
    margin-right: auto; 
    width: 800px; 
    height: 100%; 
} 
#header { 
    background-color: blue; 
    height: 150px; 
} 
#content { 
    background-color: yellow; 
} 
#footer { 
    height: 50px; 
    background-color: blue; 
} 

<html> 
    <head> 
    <link rel="stylesheet" href="test.css" type="text/css" media="screen"/> 
    </head> 
    <body> 
    <div id="container"> 
     <div id="centercolumn"> 
     <div id="header"> 
      header 
     </div> 
     <div id="content"> 
      content 
     </div> 
     <div id="footer"> 
      footer 
     </div> 
     </div> 
    </div> 
    </body> 
</html> 

답변

관련 문제