flexbox를 사용하여 '메인'태그 내부에 컨텐츠를 세로로 배치했지만 너무 많은 컨텐츠가 추가되면 '헤더'로 넘칠 수 있습니다. div가 화면의 특정 세로 위치 (헤더로 설정된 높이)보다 높으면 'main'(현재는 .vertical로 설정) 클래스를 제거한다는 계산 방법이 있습니까?두 div가 겹치는 경우 클래스 제거
.removeClass()가 클래스를 제거한다는 것을 알고 있지만, 수직 위치 계산을 시작할 위치를 모른다.
HTML
<header>Nav</header>
<main class="vertical">A lot of text here</main>
CSS
body, html{margin:0; height:100%}
header{width:100%; height:256px; background:red;}
main{width:100%; height: calc(100% - 256px); background:#fff;}
.vertical{
display: flex;
flex-direction: column;
justify-content: center;
}
내가 의미가 희망을. 감사합니다.