컨테이너가 있고이 컨테이너를 아직 넣고 싶다고 가정 해 봅시다 또 다른 컨테이너에도 다른 것들이 가득차 있습니다. CSS 코드는 다음과 같이 보일 수 있습니다상대적으로 배치 된 요소는 절대적으로 어떻게 배치합니까?
.parent-container {
width: 100%;
position: relative;
}
.child-container {
width: 600px;
position: absolute;
left: 25px;
bottom: 100px;
}
그러나 .child-container
도 position: relative
이없는 .parent-container
.child-container
인해 상대적 위치에있는 절대 위치 요소를 포함하고 있습니다. 그래서 내 질문은, .child-container
의 아이들을 상대적으로 자신에게 상대적으로 위치시킬 수 있으며, 여전히 정확하게 위치를 유지하는 것입니다. .parent-container
? P. S. 포장이 position: absolute
에서 .child-container
는 '
는 div
및 .child-container
position: relative
트릭을해야하고 D,하지만 의미 뭔가 더 ... 기대했다.
아이들을 '. – putvande