DIV로 홈페이지 레아이웃 작성하는데... > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

DIV로 홈페이지 레아이웃 작성하는데... 정보

DIV로 홈페이지 레아이웃 작성하는데...

본문

파폭에서는 전체레이아웃 가로 가운데정렬이 되는데, 익스에서는 자꾸 왼쪽으로 붙어버리네요.

아래 스타일 중 무엇이 잘못되었기에 그럴지 좀 봐주실 수 있나요?

감사합니다.

<style type="text/css">
body {height:100%;padding:0;margin:0;}
#wrap_d {width:1030px;margin:0 auto;}
  #mleft {float:left;width:900px;}
    #header_d {overflow:hidden;width:900px;height:100px;}
      #logobar_d {width:900px;height:70px;background-image:url(./img/header/logobar.gif)}
      #menu_d {float:left;overflow:hidden;width:900px;height:30px;background-color:#d6e1ea;}
    #body_d {clear:both;width:900px;}
      #body_d_ban {width:900px;margin:5px 0 0 0;}
      #body_d_m {width:900px;background-color:#ffccff;}
        #body_d_left {float:left;width:120px;background-color:#ffffff;}
        #contents_d {float:right;width:780px;}
    #footer_d {clear:both;height:35px;background-color:#434342;}
  #mright {float:right;width:130px;}
    #rightban_ {width:130px;background-color:#2f2f2e;}
</style>
  • 복사

댓글 전체

#wrap_d {width:1030px;margin:0 auto;}
는 IE에서는 가운데 정렬이 안됩니다.
div를 하나더 추가해서 text-align:center 해주시고
#wrap_d {width:1030px;margin:0 auto;text-align:left}
또는
body 에 text-align:center 추가
#wrap_d {width:1030px;margin:0 auto;text-align:left}
로 해보세요

css 중앙정렬로 구글이나 네이버 검색해보세요
CSS 중앙 정렬 방법은 간단합니다.

우선 전체 페이지를 #wrapper id로 div로 싸시고..

<body>
<div id=wrapper>
</div>
</body>
위와 같이 하시면 되겠죠..



body{
padding:0px;
margin:0px;
text-align:center;
}

#wrapper {
width:800px;
text-align:left;
margin:0 auto;
}

위와 같이 스타일을 주시면 됩니다.
너비는 알아서 지정하시고요..

파폭 등에서는 아래와 같은 스타일로 중앙 정렬이 되고..
margin:0 auto;

익스에서는
text-align:center;
위과 같은 스타일로 중앙 정렬이 됩니다.
© SIRSOFT
현재 페이지 제일 처음으로