-
카테고리
-
세부 분야
웹 개발
-
해결 여부
해결됨
#7 IE 버그 Flex로 해결 방법이 궁금합니다.
20.11.24 16:26 작성 조회수 157
0
height:100vh 및 overflow:auto 속성은 footer가 position:fixed 된 느낌이 들어, 혹시 content 가 길어질시에 밀려나도록 flex로 작업 할 수 있는 방법이 있을까요? 안된다면 어떤 방식으로 IE에서 처리할 수 있을까요? (컨텐츠 적을시, 한화면 전체가 넘어갈시 동시처리)
답변을 작성해보세요.
1
1분코딩
지식공유자2020.11.30
여러 방법이 있을 수 있는데요, 간단히 하는 방법으로 calc 함수를 이용한 방법이 있습니다.
아래 코드처럼 min-height를 calc로 설정해보세요~
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
}
header {
height: 75px;
background: blue;
}
footer {
height: 75px;
background: red;
}
article {
min-height: calc(100vh - 150px);
}
</style>
</head>
<body>
<section>
<header>header</header>
<article>article</article>
<footer>footer</footer>
</section>
</body>
</html>
0
답변 2