Files
2nd/10_Wiki/Dev/Topic_HOWTO/HOWTO_CSS_Fixed_Menu.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

3.4 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
howto-css-fixed-menu How To - Fixed Menu Web_Recipes draft conceptual
fixed navbar CSS
sticky top menu
B 0.84 2026-07-04 2026-07-04
howto
css
w3schools
layout
position
navigation
https://www.w3schools.com/howto/howto_css_fixed_menu.asp

HOWTO CSS Fixed Menu

🎯 한 줄 통찰 (One-line insight)

The recipe explicitly warns that a fixed navbar OVERLAYS page content underneath it (since position: fixed removes the element from flow, other content doesn't "know" to leave room for it) — the fix is a manual margin-top on the main content equal to or greater than the navbar's height, meaning every fixed-menu layout requires the developer to keep two separate numbers (navbar height, content margin) in sync by hand, with no built-in mechanism linking them. [S1]

🧠 핵심 개념 (Core concepts)

  • position: fixed; top: 0; — pins the menu to the top of the VIEWPORT, staying visible during scroll. [S1]
  • Overlay problem — a fixed element doesn't push other content down; without compensation, the fixed menu covers the top of the page content. [S1]
  • Manual margin-top fix — the main content block needs margin-top at least equal to the navbar's rendered height to avoid being hidden underneath it. [S1]
  • Bottom variant — swapping top: 0 for bottom: 0 creates a fixed BOTTOM menu instead, with the equivalent fix being margin-bottom on the main content. [S1]

📖 세부 내용 (Details)

  • Fixed top menu: .navbar { position: fixed; top: 0; width: 100%; overflow: hidden; background-color: #333; } .navbar a { float: left; padding: 14px 16px; color: #f2f2f2; } .main { margin-top: 30px; }. [S1]
  • Fixed bottom menu: .navbar { position: fixed; bottom: 0; width: 100%; } .main { margin-bottom: 30px; }. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

없음 — 신규 레시피, 기존 문서와 모순되는 내용 없음.

🛠️ 적용 사례 (Applied in summary)

Home/News/Contact 링크가 담긴 상단 고정 메뉴를 만들고, 콘텐츠가 가려지지 않도록 margin-top을 추가하는 예제가 원문에서 직접 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Fixed top navbar requiring a manual content offset (CSS):

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #333;
}
.main {
  margin-top: 30px; /* must match or exceed navbar height */
}

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference)
  • 신뢰 점수: 0.84
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "How To - Fixed Menu" recipe (Astra wiki-curation, P-Reinforce v3.1 format).