div position 질문드려요.. 왜 정렬이 안되죠?? 채택완료
그누초보님
9년 전
조회 5,582
안녕하세요 오늘은 div position 에 의문사항이 있어
도움을 요청하고자 합니다.
소스는 아래와 같구요
</p><p><style type="text/css"></p><p>/*탑메뉴1 */ #tmenu1 { position: fixed; width: 386px; height: 75px; left:0px; top:20px; z-index:9999; }
/*탑메뉴2 */ #tmenu2 { position: fixed; width: 328px; height: 75px; right:0px; top:20px; z-index:9999; }
/*메인화면 */ #main { position: static; width: 100%; height: 600px; background-color:yellow; }
/*메인메뉴 */ #mmenu { position: relative; width: 1532px; height: 75px; top:525px; left:50%; margin-left:-766px; background-color:red; z-index:8888; }
/*메인배경1 */ #mbg1 { position: relative; width: 676px; height: 402px; bottom:0px; left:50%; margin-left:0px; background-color:cyan; z-index:17777; }</p><p> </p><p></style></p><p><div id="tmenu1"><img src="<?php echo G5_THEME_IMG_URL ?>/tmenu1.png"></div>
<div id="tmenu2"><img src="<?php echo G5_THEME_IMG_URL ?>/tmenu2.png"></div></p><p><div id="main">
<div id="mmenu"></div>
<div id="mbg1"></div>
</div></p><p>
소스는 위와 같구요
아래는 현재 상태입니다.

main 안에 있는 mbg1을 bottom:0px 을 줘봐도
노란색 main 밑부분에 붙질 알고 저렇게 떠있습니다.
혹시나해서 top:0px 을 줘도 노란색 main 맨 윗부분에 붙지를 않구요ㅠㅠ
어디가 잘못된걸까요??
제가 하고 싶은건 mbg1 저녀석을 노란색 main 아랫부분에 붙이고 싶습니다 ㅠㅠ

이렇게요..
어딜 잘못건드린걸까요??
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
9년 전
#main에 position:relative;를 하시고
#mbg1에 position:absolute;를 하시면 자기 부모를 기준으로 absolute가 됩니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
그누초보님
9년 전
답변감사합니다!!!
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인