위토즈 - 개발자프로그램판매공간

정보공유

[퍼블리싱] div 기본 레이아웃 샘플

 

 

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 <title>WebBrochure</title>

 <style type="text/css">

  html, body {

   height: 100%;

   overflow: hidden;

  }

  body {

   font: 62.5% Verdana;

   margin: 0em;

   padding: 0em;

  }

  div {

   margin-right: auto;

   margin-left: auto;

  }

  div#container {

   height: auto !important;

         height: 100%;

         min-height: 100%;

         background: #82C71B;

         width: 80em;

  }

  div#header {

   height: 10em;

   background: #FF9999;

   width: 78em;

  }

  div#content {

   width: 74em;

   overflow: auto;

   background: #FFFFFF;

   padding-right: 1em;

   padding-left: 1em;

  }

  div#footer {

   height: 5em;

   width: 78em;

   background: #999999;

  }

 </style>

 <script type="text/javascript">

  window.onload = function() {

   contentHeight();

  }

  window.onresize = function() {

   contentHeight();

  }

 

 function contentHeight() {

   if (document.getElementById) {

    var windowHeight = getWindowHeight();

    var headerHeight = document.getElementById('header').offsetHeight;

    var footerHeight = document.getElementById('footer').offsetHeight;

    var contentElement = document.getElementById('content');

    //alert("windowHeight:"+windowHeight+",\nheaderHeight: "+headerHeight+", \nfooterHeight:"+footerHeight);

    contentElement.style.height = (windowHeight - (headerHeight + footerHeight)) + 'px';

   }

  }

 

 function getWindowHeight() {

   var windowHeight = 0;

 

  if (typeof(window.innerHeight) == 'number') {

    windowHeight = window.innerHeight;

   } else {

    if (document.documentElement && document.documentElement.clientHeight) {

     windowHeight = document.documentElement.clientHeight  ;

    } else {

     if (document.body && document.body.clientHeight) {

      windowHeight = document.body.clientHeight;

     }

    }

   }

   return windowHeight;

  }

 </script>

 

 

 

  <div id="container">

   <div id="header">HEADER</div>

   <div id="content"><b>CONTENT</b></div>

   <div id="footer">FOOTER</div>

  </div>

 

 

정보공유
Total 45건 3 페이지
번호 제목 글쓴이 날짜 조회
15 윈도우 환경에서 LESS 파일 컴파일 설정 방법 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-22 49164
14 모바일에서 헤더부분 상단 고정시킬때 IOS 환경에서 손을때기전에는 활성화가 안되는경우. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-21 39374
13 아이프래임 iframe 레이어 처리. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-18 35553
12 CSS Reset 플러그인. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-07 36514
11 레이아웃용 테이블에<th>나scope이 사용될 경우에는 오류임. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 07-04 44723
10 심플한 css 디자인 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 06-01 34767
9 가로세로 사이즈가 정해져 있지 않을때 비율대로 보여지게 하기. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-07 34733
8 position absolute 로 right 로 주었다고 left 로 변경해야할 경우. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 06-18 32853
7 이미지를 css 로 비율대로 처리하기. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 06-02 33723
6 css 박스 배치 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 04-10 32479
5 css 마크업 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 01-29 34854
4 IE 6,7 에서 inline-block 되게 하는 방법. 댓글2 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-18 33770
3 jquery 드롭다운메뉴 모음. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-28 50092
2 NHN Coding Convention 2343423쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-26 26492
열람중 div 기본 레이아웃 샘플 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-05 31956