Files
2nd/10_Wiki/Topic_Programming/Topic_CSS/CSS_Box_Model.md
T
Antigravity Agent e9cbf23ab5 docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
2026-07-05 00:39:13 +09:00

4.7 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
css-box-model CSS Box Model Frontend draft conceptual
box model
CSS box model
content padding border margin
element box
total width
B 0.90 2026-06-23 2026-06-23
css
web
frontend
w3schools
box-model
layout
https://www.w3schools.com/css/css_boxmodel.asp

CSS Box Model

🎯 한 줄 통찰 (One-line insight)

Every HTML element is a box made of four layers — content, padding, border, and margin — and the declared width/height set only the content area, so the box's real footprint adds padding and border on top. [S1]

🧠 핵심 개념 (Core concepts)

  • Box model — every HTML element is wrapped in a box that consists of four layers moving outward: content, padding, border, and margin. [S1]
  • Content — "The content of the box, where text and images appear." [S1]
  • Padding — "Clears an area around the content. The padding is transparent." [S1]
  • Border — "A border that goes around the padding and content." [S1]
  • Margin — "Clears an area outside the border. The margin is transparent." [S1]
  • Width/height are content-only — "When you set the width and height properties of an element with CSS, you just set the width and height of the content area." [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Total size formula — total width = content width + left/right padding + left/right border; total height = content height + top/bottom padding + top/bottom border. [S1]
  • Margin excluded from box size — margin affects the space the box takes on the page but is not included in the actual size of the box. [S1]

📖 세부 내용 (Details)

The four components The CSS box model describes how every HTML element is wrapped in a box around it, consisting of four layers moving outward: [S1]

  • Content — the content of the box, where text and images appear.
  • Padding — clears an area around the content; the padding is transparent.
  • Border — a border that goes around the padding and content.
  • Margin — clears an area outside the border; the margin is transparent.

Basic example [S1]

div {
  width: 300px;
  border: 15px solid green;
  padding: 50px;
  margin: 20px;
}

Width and height calculation The tutorial emphasizes: "When you set the width and height properties of an element with CSS, you just set the width and height of the content area." To calculate the full size of an element, you must also add padding and borders. [S1]

For a div styled with width: 320px; height: 50px; padding: 10px; border: 5px solid gray; margin: 0;: [S1]

Total width: [S1]

320px (content width)
+ 20px (left + right padding)
+ 10px (left + right border)
= 350px (total width)

Total height: [S1]

50px (content height)
+ 20px (top + bottom padding)
+ 10px (top + bottom border)
= 80px (total height)

Note "The margin property also affects the total space that the box will take up on the page, but the margin is not included in the actual size of the box." [S1]

🛠️ 적용 사례 (Applied in summary)

The basic div example and the dimensioned calculation example are the page's own applied cases, demonstrating the layers and the total-size arithmetic. No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

A box exercising all four layers (language: CSS):

div {
  width: 300px;
  border: 15px solid green;
  padding: 50px;
  margin: 20px;
}

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

No contradictions found in the source.

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.90
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "CSS Box Model" page (Astra wiki-curation, P-Reinforce v3.1 format).