9609c04755
W3Schools 튜토리얼을 P-Reinforce v3.1 포맷으로 위키화(영어 본문, 한/영 섹션 헤더). - Topic_HTML: 59문서 (튜토리얼+예제, 레퍼런스/메타 제외) - Topic_CSS: 190문서 (메인 + Advanced/Flexbox/Grid/RWD 전체) - Topic_JavaScript: 120문서 (코어 언어; Temporal/DOM상세/BOM/WebAPI/AJAX/jQuery/Graphics 등은 후속) 각 폴더 00_INDEX.md(MOC) 포함. 코드 verbatim, 미확인분은 "Not found in source" 표기. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
102 lines
4.1 KiB
Markdown
102 lines
4.1 KiB
Markdown
---
|
|
id: css-height-and-width
|
|
title: "CSS Height and Width"
|
|
category: "Frontend"
|
|
status: "draft"
|
|
verification_status: "conceptual"
|
|
canonical_id: ""
|
|
aliases: ["height", "width", "CSS height", "CSS width", "element dimensions"]
|
|
duplicate_of: ""
|
|
source_trust_level: "B"
|
|
confidence_score: 0.88
|
|
created_at: 2026-06-23
|
|
updated_at: 2026-06-23
|
|
review_reason: ""
|
|
merge_history: []
|
|
tags: ["css", "web", "frontend", "w3schools", "height", "width", "box-model"]
|
|
raw_sources: ["https://www.w3schools.com/css/css_height_width.asp"]
|
|
applied_in: []
|
|
github_commit: ""
|
|
---
|
|
|
|
# [[CSS Height and Width]]
|
|
|
|
## 🎯 한 줄 통찰 (One-line insight)
|
|
The `height` and `width` properties set the size of the area inside the padding, border, and margin of an element — they do not include padding, borders, or margins. [S1]
|
|
|
|
## 🧠 핵심 개념 (Core concepts)
|
|
- **Purpose** — the `height` and `width` properties set the height and width of the area inside the padding, border, and margin of the element. [S1]
|
|
- **Content-only** — these properties size the content area; they do not include padding, borders, or margins in their calculations. [S1]
|
|
- **Accepted values** — `auto` (browser calculates dimensions; default), a length (px, cm, em, etc.), `%` (percentage of the containing block), `initial` (default value), or `inherit` (inherited from parent). [S1]
|
|
|
|
## 🧩 추출된 패턴 (Extracted patterns)
|
|
- **Fixed vs. fluid** — combine a length on one axis with a `%` on the other (e.g., fixed `height` + percentage `width`) for partially responsive boxes. [S1]
|
|
- **Content-box mental model** — when reasoning about an element's footprint, add padding and border to the declared `height`/`width`, since those are excluded. [S1]
|
|
|
|
## 📖 세부 내용 (Details)
|
|
**What height and width do**
|
|
The CSS `height` and `width` properties set the height and width of the area inside the padding, border, and margin of the element. This means they do not include padding, borders, or margins in their calculations. [S1]
|
|
|
|
**Accepted values**
|
|
The `height` and `width` properties accept: [S1]
|
|
- `auto` — the browser calculates the dimensions (this is the default)
|
|
- a length — specific values in px, cm, em, etc.
|
|
- `%` — a percentage of the containing block
|
|
- `initial` — sets the property to its default value
|
|
- `inherit` — the property is inherited from the parent
|
|
|
|
**Example 1** — fixed height with percentage width: [S1]
|
|
```css
|
|
div {
|
|
height: 200px;
|
|
width: 50%;
|
|
background-color: powderblue;
|
|
}
|
|
```
|
|
|
|
**Example 2** — fixed height and fixed width: [S1]
|
|
```css
|
|
div {
|
|
height: 100px;
|
|
width: 500px;
|
|
background-color: powderblue;
|
|
}
|
|
```
|
|
|
|
**Note**
|
|
The tutorial emphasizes: "Remember that the height and width properties do not include padding, borders, or margins!" [S1]
|
|
|
|
## 🛠️ 적용 사례 (Applied in summary)
|
|
The two `div` examples are the page's own applied cases, demonstrating fixed and percentage-based sizing. No external project/commit applications found in the source.
|
|
|
|
## 💻 코드 패턴 (Code patterns)
|
|
Size a box's content area (language: CSS):
|
|
```css
|
|
div {
|
|
height: 200px;
|
|
width: 50%;
|
|
background-color: powderblue;
|
|
}
|
|
```
|
|
|
|
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
|
|
No contradictions found in the source.
|
|
|
|
## ✅ 검증 상태 및 신뢰도
|
|
- **상태:** draft
|
|
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
|
|
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
|
|
- **신뢰 점수:** 0.88
|
|
- **중복 검사 결과:** 신규 생성 (New discovery)
|
|
|
|
## 🔗 지식 그래프 (Knowledge Graph)
|
|
- **상위/루트:** [[CSS Tutorial]]
|
|
- **관련 개념:** [[CSS Max-width and Min-width]], [[CSS Box Model]], [[CSS Padding and Box Sizing]]
|
|
- **참조 맥락:** Referenced whenever an element's content-area dimensions must be set explicitly.
|
|
|
|
## 📚 출처 (Sources)
|
|
- [S1] W3Schools — CSS Height and Width — https://www.w3schools.com/css/css_height_width.asp
|
|
|
|
## 📝 변경 이력 (Change history)
|
|
- 2026-06-23: Initial draft synthesized from the W3Schools "CSS Height and Width" page (Astra wiki-curation, P-Reinforce v3.1 format).
|