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

정보공유

[퍼블리싱] 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 438건 13 페이지
번호 제목 글쓴이 날짜 조회
258 자바스크립트 배열 디버그. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 02-24 33046
257 네이버 로그인 API 키 받기 (WEB 서비스 예제) 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-17 33007
256 php 현재 페이지 주소 알아내기 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-21 32913
255 유니크 한 일련번호 생성하기. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-17 32873
254 주민번호로, 생년월일로 나이계산 함수 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-02 32823
253 css 박스 배치 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 04-10 32799
252 [고도몰 튜닝 팁 Tip] 테이블 선언 파일 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 04-08 32649
251 연락처 앞대가리 목록 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11-14 32547
250 get_magic_quotes_gpc 가 on 으로 되어있는경우 해결법. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 04-21 32537
249 ajax 를 이용한 비동기식 삭제 데이터 처리. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 05-20 32365
248 정규식을 이용하여 날짜값 확인 방법 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 04-25 32350
247 즐겨쓰는 php db 연결문 (접속 - 해제) 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 02-24 32307
열람중 div 기본 레이아웃 샘플 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-05 32283
245 한글 초성 추출하기 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-30 32127
244 그누보드5 날짜 표시형식 바꾸기 댓글1 장앙마쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 07-03 31934