페이지 중앙정렬이 안되요;;

· 14년 전 · 968 · 11
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/setpage.php");
include_once("$g4[path]/lib/thumb.lib.php");
/*
$xml = file_get_contents("{$g4[path]}/flash/mainmenu.xml");
$parser = new XMLParser($xml);
$parser->Parse();
*/
 
$cPos = substr($fixPageMode,0,1);
$fixNum = "";
if($cPos == "x"){
 $fixNum = 5;
}elseif($cPos == "y"){
 $fixNum = 6;
}else{
 $fixNum = substr($fixPageMode,1,2) - 1;
}

if($sel_id){
 $fixPageMode = substr($fixPageMode,0,4) . $sel_id ;
 
}

?>
<div id="subbg">
<div id="subwrapper">
<div id="header"><script language=javascript>flash_movie2("<?=$g4[path]?>/flash/mainnavi.swf", "mainnavi", 950, 120, "transparent");</script></div>
<div id="subvisual"><? include_once("subvisual.php") ?></div>
<div id="subcontent">
<div id="subcon1"><? include_once("../sub1/leftmenu.php") ?></div>
<div id="subcon2"><img src="../images/sub1title.jpg">
 
 
 
 
#subbg {
 width:950px;
 background:url(/images/bg.jpg) repeat-x;
}
#subwrapper {
 margin:auto;
 width:950px;
}
 
이런식으로 되어있는데요 메인페이지도 똑같이 했는데 메인은 중앙정렬이 됐거든요
 
근데 서브는 중앙으로 움직일 생각을 안하네요 이거 왜이럴까요 도와주세요 ㅠ
|

댓글 11개

상단 include에서 css 파일은 불러들이셨죠?

#subwrapper 에서
margin:0 auto; 로 수정해보세요..

아주가끔css 꼬여서 이도저도 안되면 <center> 때려넣어버리기도 합니다..
subbg 안에 subwrapper 가 포함되는 형식이라 지금은 subbg 에 margin: 0 auto; 를 넣으셔야 할겁니다.
subbg, subwrapper 가 동일하게 가로 950인데 부모격인 subbg 는 기본정렬이 좌측이니 950 내에서 950을 가진 subwrapper 가 화면 중앙으로 올 수가 없는 것이죠.
subwrapper 크기를 950보다 작게 하시고 margin: 0 auto 로 스타일 주시고 테스트해보시면 금방 이해되실 겁니다.
<div id="subwrapper" class="subbg">

#subwrapper {
margin: 0 auto;
width:950px;
}
.subbg {
background:url(/images/bg.jpg) repeat-x;
}

이렇게 하면 안되는건가요 -ㅅ- 백그라운드가 중복되는게 아니라면 그냥 클래스로 처리해줘도 될것 같습니다만...
DTD가 정의되어있어야해요
댓글 달아주신 선배님들 모두모두 감사합니다 ( _ _ )
천천히 읽어보고 똑같이 따라한다고 했는데 먼가 제대로 안했나봐요 ^^;;;
계속 도전해야겠습니다
네이트온으로 한번 봐드릴까요?
쪽지로 네이트온 아이디 보내주세요.
제 생각도 DTD 선언-ㅅ-
익스에서는 body 에 text-align:center; 이 있어야합니다. body {text-align:center;} 그리고 전체를 감싸고 있는게 #subbg 라면 여기에 #subbg {margin:0 auto; text-align:left;} 이렇게 줘보세요.
드림위버라면 머리태그 속성에서 중앙정렬시키면되지않나요?;;
<div style="width:100%; text-align:center;">
<div style="width:950px; margin:0 auto;">
내용
</div>
</div>

이런 방식이 아니면 LaRuota님 처럼 <center></center>를 넣어주셔도 될듯합니다.
대신 최 상위의 개념으로 center를 사용하셔야 할듯.
댓글을 작성하시려면 로그인이 필요합니다.

디자인

+
제목 글쓴이 날짜 조회
14년 전 조회 861
14년 전 조회 1,224
14년 전 조회 5,269
14년 전 조회 2,770
14년 전 조회 2,165
14년 전 조회 2,214
14년 전 조회 4,658
14년 전 조회 1,801
14년 전 조회 2,066
14년 전 조회 2,735
14년 전 조회 1,265
14년 전 조회 3,442
14년 전 조회 1,216
14년 전 조회 1,105
14년 전 조회 1,964
14년 전 조회 2,111
14년 전 조회 714
14년 전 조회 2,149
14년 전 조회 2,227
14년 전 조회 2,596
14년 전 조회 1,775
14년 전 조회 1,359
14년 전 조회 2,104
14년 전 조회 1,697
14년 전 조회 867
14년 전 조회 1,589
14년 전 조회 5,865
14년 전 조회 3,651
14년 전 조회 4,030
14년 전 조회 2,546
14년 전 조회 1,990
14년 전 조회 762
14년 전 조회 2,242
14년 전 조회 1,299
14년 전 조회 1,477
14년 전 조회 1,270
14년 전 조회 1,158
14년 전 조회 2,010
14년 전 조회 742
14년 전 조회 647
14년 전 조회 1,094
14년 전 조회 1,029
14년 전 조회 1,180
14년 전 조회 2,018
14년 전 조회 777
14년 전 조회 1,601
14년 전 조회 844
14년 전 조회 1,250
14년 전 조회 1,745
14년 전 조회 969
14년 전 조회 1,907
14년 전 조회 2,133
14년 전 조회 2,616
14년 전 조회 2,130
14년 전 조회 1,258
14년 전 조회 972
14년 전 조회 2,513
14년 전 조회 784
14년 전 조회 1,046
14년 전 조회 1,027
14년 전 조회 1,315
14년 전 조회 1,133
14년 전 조회 731
14년 전 조회 876
14년 전 조회 1,356
14년 전 조회 791
14년 전 조회 688
14년 전 조회 883
14년 전 조회 844
14년 전 조회 3,113
14년 전 조회 889
14년 전 조회 964
14년 전 조회 993
14년 전 조회 1,020
14년 전 조회 1,020
14년 전 조회 729
14년 전 조회 5,452
14년 전 조회 1,162
14년 전 조회 1,898
14년 전 조회 1,156
14년 전 조회 2,283
14년 전 조회 1,052
14년 전 조회 1,450
14년 전 조회 3,239
14년 전 조회 2,031
14년 전 조회 1,099
14년 전 조회 3,270
14년 전 조회 3,572
14년 전 조회 3,369
14년 전 조회 3,084
14년 전 조회 5,336
14년 전 조회 5,781
14년 전 조회 3,557
14년 전 조회 6,095
14년 전 조회 5,844
14년 전 조회 3,841
14년 전 조회 818
14년 전 조회 1,182
14년 전 조회 1,737
14년 전 조회 1,320