모든 페이지의 헤더/푸터 숨김 처리는 사이트 리뉴얼이나 사이트 점검 등 전체 사이트가 노출되지 않아야 하는 특정 상황에서만 활용해 주시기 바랍니다.
정상 운영 시에는 헤더와 푸터를 숨기지 않는 것을 권장합니다.
아래의 HTML 소스코드를 헤더 영역의 HTML 섹션에 입력하면 헤더와 푸터 섹션을 숨길 수 있습니다.
•
모든 페이지의 헤더 섹션 숨기기
<script>
document.querySelector('#header').style.display = 'none';
</script>
HTML
복사
•
모든 페이지의 푸터 섹션 숨기기
<script>
document.querySelector('footer').style.display = 'none';
</script>
HTML
복사
•
모든 페이지의 헤더와 푸터 섹션 숨기기
<script>
document.querySelector('#header').style.display = 'none';
document.querySelector('footer').style.display = 'none';
</script>
HTML
복사
•
홈페이지(메인 페이지)에만 헤더 섹션 숨기기
<script>
if(location.pathname === '/') {
document.querySelector('#header').style.display = 'none';
}
</script>
HTML
복사
•
홈페이지(메인 페이지)에만 푸터 섹션 숨기기
<script>
if(location.pathname === '/') {
document.querySelector('footer').style.display = 'none';
}
</script>
HTML
복사

