다음 페이지가 있습니다.
스타일 :CSS 중심의 div가 나란히 있습니다
.featuredcontainer {
width: 450px;
height: 700px;
margin-left: auto;
margin-right: auto;
position: relative;
right: 160px;
top: 30px;
border: 1px groove grey;
}
.navcontainer
{
margin-left: auto;
margin-right: -8px;
position: relative;
top: 75px;
height: 600px;
width: 300px;
}
그리고 예를 들어 HTML은 :
<div class="featuredcontainer">
content
</div>
<div class="lessonnavcontainer">
menu
</div>
페이지가 표시됩니다. navcontainer는 오른쪽에 있지만 기능 컨테이너 아래에 있습니다. 상대 위치 지정을 사용하여 navcontainer를 이동하면 올바르게 보이지만 페이지 하단에 빈 공간이 있습니다. 나는 무엇을해야합니까?
'float : left'를 두 클래스 모두에 추가해보십시오. –
이제 그들은 서로 옆에 있지만 페이지 크기를 조정하지 않고 움직이지 않고 엉망인 위치에 있습니다. – Jaxkr
모두 '위쪽'및 '오른쪽'을 삭제하고 두 div를 부모 div 내에 넣습니다.