Files
2nd/10_Wiki/Dev/Topic_HOWTO/HOWTO_CSS_Vertical_Line.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.5 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-vertical-line How To - Vertical Line Web_Recipes draft conceptual
border-left divider CSS
B 0.8 2026-07-04 2026-07-04
howto
css
w3schools
layout
border
https://www.w3schools.com/howto/howto_css_vertical_line.asp

HOWTO CSS Vertical Line

🎯 한 줄 통찰 (One-line insight)

A "vertical line" isn't a special CSS shape primitive at all — it's an empty <div> with height set and ONLY a border-left declared (no other sides), and centering it uses a variant of the absolute-positioning trick already seen elsewhere: left: 50%; margin-left: -3px; (half of the 6px border width, negated) achieves the same "shift back by half my own size" effect that transform: translateX(-50%) would, just computed manually instead of automatically. [S1]

🧠 핵심 개념 (Core concepts)

  • border-left only, on an empty div.vl { border-left: 6px solid green; height: 500px; } — no width, no content; the border alone forms the visible line. [S1]
  • Manual half-width offset for centeringleft: 50%; margin-left: -3px; (half of the 6px border, negated) recenters the line, since left: 50% alone would place its LEFT EDGE at the midpoint rather than centering the line itself. [S1]

📖 세부 내용 (Details)

  • Basic vertical line: .vl { border-left: 6px solid green; height: 500px; } applied to an empty <div class="vl"></div>. [S1]
  • Centered version: .vl { border-left: 6px solid green; height: 500px; position: absolute; left: 50%; margin-left: -3px; top: 0; }. [S1]

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

  • transform 대신 수동 margin 계산으로 중앙 정렬: [[HOWTO CSS Center Vertical]]transform: translate(-50%, -50%)가 자동으로 자기 자신의 절반만큼 되돌리는 것과 달리, 이 레시피는 테두리 두께(6px)의 절반인 -3px를 margin-left로 수동 계산해 동일한 효과를 낸다는 점이 확인됨 — 같은 목적을 자동 vs 수동 방식으로 각각 구현. [S1]

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — 초록색 6px 세로선을 만들고 화면 중앙에 배치하는 최소 예제가 원문에서 제시됨. [S1]

💻 코드 패턴 (Code patterns)

An empty div with only border-left, centered via manual margin offset (CSS):

.vl {
  border-left: 6px solid green;
  height: 500px;
  position: absolute;
  left: 50%;
  margin-left: -3px; /* half of border-left width, negated */
  top: 0;
}

검증 상태 및 신뢰도

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

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

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