사이트 내 전체검색

HTML

가운데 정렬 익스플로러 버전 별 스타일 다르게 주기 / 브라우저 별 가운데 정렬

페이지 정보

작성자 최고관리자 댓글 0건 조회 1,171회 작성일 17-12-19 15:51

본문

익스플로러 및 다른 브라우저 가운데 정렬

최신은 <div style=”width:1000px;margin:0 auto;”>가운데</div>

<!-- 익스플로러 버전 별 스타일 다르게 주기-->
< !-- 익스 가운데 정렬 -->
     <!--[if lt IE 7]>      <html class="no-js old-ie ie6"> <![endif]-->
     <!--[if IE 7]>         <html class="no-js old-ie ie7"> <![endif]-->
     <!--[if IE 8]>         <html class="no-js old-ie ie8"> <![endif]-->
     <!--[if IE 9]>         <html class="no-js old-ie ie9"> <![endif]-->
     <!--[if gt IE 9]><!--> <html lang="ko-KR" class="no-js"> <!--<![endif]-->
< style type="text/css">
  body {text-align:center}
     div#main {margin:0 auto;width:1200px; border:1px solid blue;}
     .old-ie div#main {width:1200px; border:1px solid green; text-align:left;} /*익스 하위버전에서는 body를 가운데 정렬 시키고 div(#main)을 왼쪽정렬로 한다(이래 하지 않으면 div 안의 내용이 가운데 정렬 ㅠㅜ)
  div#wrap {border:1px solid blue; width:960px; height:100px;}
  div#side {border:1px solid blue; width:200px; height:500px; float:left;}
  div#contents {border:1px solid blue; width:750px; height:400px; float:left;}
  div#footer {border:1px solid blue; width:960px; height:50px; clear:left;}
< /style>
< div id="main">
     <div id="wrap">TOP</div>
     <div id="side">Side</div>
     <div id="contents">Contents</div>
     <div id="footer">Foot</div>
< /div>

댓글목록

등록된 댓글이 없습니다.


CE.M
Copyright © calcevery.me. All rights reserved.
login