<div class="test1">
<div class="test2">2</div>
</div>
.test1{position:relative; width:200px; height:200px; margin-left:100px; margin-top:100px; }
.test2{position:absolute; width:50px; height:50px; left:0px; top:0px; }
일 경우
.test2 의 위치는 기준점이 모니터 좌측상단 (0, 0)가 아니라 test1 요소의 왼쪽 최상단이 기준점이 됨.
댓글 없음:
댓글 쓰기