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

정보공유

[퍼블리싱] 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 437건 28 페이지
번호 제목 글쓴이 날짜 조회
32 NHN Coding Convention 2343423쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-26 26554
31 jquery 롤링 모음. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-25 39489
30 addthis api 소스 (손쉬운 SNS 연동 모듈) 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-24 38113
29 capcha 캡챠 스팸방지 코드 오류, 깨짐, 엑박 뜰경우. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-23 42990
28 애드센스 반응형 광고 단위 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-23 38180
27 구글 페이지 번역 api 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10-02 37856
26 이미지 src replace 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 09-23 31279
25 지역별 우편번호 정리. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-16 28232
24 cURL 모듈 사용가능여부 판단. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 06-15 30929
23 정규식 참고 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-27 29603
22 메일주소 정규식 체크 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-25 29830
21 유니크 한 일련번호 생성하기. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-17 32657
20 원하는 자릿수 만큼 문자열 생성처리 함수. sprintf 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-11 28556
19 jQuery blockUI plugin 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-08 31296
열람중 div 기본 레이아웃 샘플 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 03-05 32026