저 정신이없는건가요? 틀린건가요?
맨날가지고 노는걸 요즘잠을 재대로 못봐서
짧은거 하나.... 이거 맞는데 왜안되지 그러고 앉아있어요;;
정신이 없는건가요? 틀린건가요?
<html>
<head>
<title>제작중</title>
<style>
#wrapper {width: 952px; margin: auto;}
#top{width:952px; height:40px; background:url(Mu.png);}
#sub{width:952px; height:30px; background:url(sub.png);}
</style>
</head>
<body>
<div id="wrapper">
<div id="top">d</div>
<div id="sub">d</div>
</div>
</body>
</html>
짧은거 하나.... 이거 맞는데 왜안되지 그러고 앉아있어요;;
정신이 없는건가요? 틀린건가요?
<html>
<head>
<title>제작중</title>
<style>
#wrapper {width: 952px; margin: auto;}
#top{width:952px; height:40px; background:url(Mu.png);}
#sub{width:952px; height:30px; background:url(sub.png);}
</style>
</head>
<body>
<div id="wrapper">
<div id="top">d</div>
<div id="sub">d</div>
</div>
</body>
</html>
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 13개
추가
margin:auto; 이러면 지금까지 잘됬는데 ㅠㅠ 왜지금은 안되는걸까용 ㅠㅠ
저도 웹표준관련 책을 최근봐서 - -
margin:auto; 이렇게 중앙정렬했는데 갑자기 안되네용 ㅠㅠ
역시 네이버에서도 저렇게 나오는데 ㅠㅠ
카피해서보면 잘되는데 제가 짜면 안되네용 ㅠㅠ
아까 저도 막 급하게 코딩하다가
hegit 이렇게 타이핑 한걸 한참 못 찾았음... ㅋㅋㅋ
#wrapper {width: 952px; margin: 0 auto;}
아님 <div id="top"> 예를 가운데 정렬을 하되 text-align 은 left 로 한다는거에요?
그럼 # top 도 margin 0 auto 하믄 되요.
안될리가 없잖아요.. -..-;;
왜그러죵 제컴이 후진건가용? ㅠㅠ 제머리상태가 후달달한건가용 ㅠㅠ흐엉
당근 안되죠... 그누보드 4는 quirks mode 니까
DTD 선언을 하세요.. 그럼 돼요....
DTD 선언하기 싫으면 width 를 반으로 나눠서 하는 방법이 있긴한데...
코딩이 걸레가 되서 보기도 않좋고... 나중에 여러가지로 귀찮아요....
그냥 DTD 선언하세요.
아... dtd선언 때문인건가봐여ㅋㅋ
#wrapper {width:100%; margin:0 auto;border:1px solid #000;text-align:center;}
#top{width:952px; height:40px; background:url(Mu.png);border:1px solid #000;}
#sub{width:952px; height:30px; background:url(sub.png);border:1px solid #000;}
</style>
이렇게 하시면 됩니다.
text-align 은 text 를 정렬하라고 있는겁니다.
스타일시트는 저거에 제일 민감하니까요.
로컬에서는 먹는데 서버에서는 안먹으면 서버 마임설정이 문제더라고요..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
<style type="text/css">
* {padding:0; margin:0}
#wrapper {margin: 0 auto; width:952px}
#top{width:952px; height:40px; background:url(Mu.png);}
#sub{width:952px; height:30px; background:url(sub.png);}
</style>
</head>
<body>
<div id="wrapper">
<div id="top">d</div>
<div id="sub">d</div>
</div>
</body>
</html>