1cfd3bbb56
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고, Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
3.9 KiB
3.9 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-sidebar | How To - Fixed Sidebar | Web_Recipes | draft | conceptual |
|
B | 0.83 | 2026-07-04 | 2026-07-04 |
|
|
HOWTO CSS Fixed Sidebar
🎯 한 줄 통찰 (One-line insight)
Just like the fixed-top-menu recipe, this pattern requires the SAME manual "keep two numbers in sync" discipline — the sidebar's width and the main content's margin-left must match exactly, or the content either overlaps the sidebar (margin too small) or leaves an awkward gap (margin too large); z-index: 1 is also added here specifically because the sidebar sits alongside scrollable content rather than above/below it, making stacking order collisions more likely than in the top/bottom fixed-menu case. [S1]
🧠 핵심 개념 (Core concepts)
position: fixed; top: 0; left: 0;— pins the sidebar to the left edge of the viewport. [S1]z-index: 1— ensures the sidebar stays above other page content in stacking order. [S1]overflow-x: hidden— prevents horizontal scrollbars from appearing inside the fixed sidebar. [S1]- Matching
margin-lefton.main— must equal the sidebar's declaredwidth(e.g. both160px) to avoid overlap. [S1] - Full-height vs. auto-height variants —
height: 100%makes the sidebar span the entire viewport height; omitting it lets the sidebar size to its own content instead. [S1] - Small-screen responsiveness —
@media screen and (max-height: 450px)reduces padding/font-size on short viewports (not a width breakpoint — a HEIGHT breakpoint, unusual compared to most responsive recipes in this cookbook). [S1]
📖 세부 내용 (Details)
- Full example:
.sidenav { height: 100%; width: 160px; position: fixed; z-index: 1; top: 0; left: 0; background-color: #111; overflow-x: hidden; padding-top: 20px; } .sidenav a { padding: 6px 8px 6px 16px; color: #818181; display: block; } .main { margin-left: 160px; padding: 0px 10px; }. [S1] - Short-viewport adjustment:
@media screen and (max-height: 450px) { .sidenav { padding-top: 15px; } .sidenav a { font-size: 18px; } }. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
없음 — 신규 레시피, 기존 문서와 모순되는 내용 없음.
🛠️ 적용 사례 (Applied in summary)
About/Services/Clients/Contact 링크가 담긴 좌측 고정 사이드바를 만들고, 본문에 동일한 margin-left를 줘 겹치지 않게 하는 예제가 원문에서 직접 제시됨. [S1]
💻 코드 패턴 (Code patterns)
Fixed sidebar with matching content margin (CSS):
.sidenav {
height: 100%;
width: 160px;
position: fixed;
z-index: 1;
top: 0; left: 0;
overflow-x: hidden;
}
.main {
margin-left: 160px; /* must match sidenav width */
}
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference)
- 신뢰 점수: 0.83
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: W3Schools HOW TO
- 관련 개념: HOWTO CSS Fixed Menu, HOWTO JS Sidenav, HOWTO CSS Sidebar Responsive
- 참조 맥락: CSS Layout & Positioning 섹션.
📚 출처 (Sources)
- [S1] W3Schools — How To - Fixed Sidebar — https://www.w3schools.com/howto/howto_css_fixed_sidebar.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "How To - Fixed Sidebar" recipe (Astra wiki-curation, P-Reinforce v3.1 format).