인프런 커뮤니티 질문&답변
레이아웃 실습 질문
작성
·
305
답변 2
1
0
Dongho Lee
지식공유자
사실 이 부분은 제법 어렵습니다.
우선 container 부분에 height 값이 있다면 그 자식 요소에 height: 100% 지정할 수 있겠습니다만, 컨텐츠 내용에 따라 유동적이어야 한다는 전제가 있다면 쉽게 해결이 안됩니다. 그래서 고전적인 방법으로 container 에 배경을 깔아서 column 들이 꽉 찬 것처럼 작업을 많이 했었습니다.
요즘엔 display: flex 를 활용해서 간단히 해결하고 있습니다.
<style>
* {margin: 0; padding: 0; box-sizing: border-box}
html,body {height: 100%}
#wrap {display: flex; flex-direction: column}
#header {padding: 30px; background-color: lightblue}
#container {display: flex; flex-direction: row}
#container .column {padding: 30px}
#container .column.aside {width: 25%; background-color: rgba(230,199,164,1)}
#container .column.content {width: 50%; background-color: rgba(213,230,165,1)}
#footer {padding: 30px; background-color: gray}
</style>








