Files
2nd/10_Wiki/Topic_CSS/CSS_Font_Size.md
T
koriweb 9609c04755 docs(10_Wiki): W3Schools 위키화 — HTML/CSS/JavaScript(core)
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>
2026-06-23 19:21:18 +09:00

5.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-font-size CSS Font Size Frontend draft conceptual
font-size
CSS font size
px em rem
viewport font size
responsive text size
B 0.87 2026-06-23 2026-06-23
css
web
frontend
w3schools
fonts
typography
https://www.w3schools.com/css/css_font_size.asp

CSS Font Size

🎯 한 줄 통찰 (One-line insight)

The font-size property sets text size using absolute units (px, keywords) or relative units (em, rem, %, vw); use px for fixed control, em/rem for scalable accessible designs, and rem for consistency since it always refers to the root <html> font size. [S1]

🧠 핵심 개념 (Core concepts)

  • font-size property — used to specify the size of the text/font; the page emphasizes proper semantic HTML usage for headings and paragraphs. [S1]
  • Absolute sizespx (pixels) for fixed, precise control, plus keyword sizes: xx-small, x-small, small, medium, large, x-large, xx-large. [S1]
  • Relative sizesem (relative to the parent element's font size), rem (relative to the root <html> element's font size), % (relative to the parent), and smaller/larger (relative to the parent). [S1]
  • rem consistencyrem always refers to the font-size of the <html> element, regardless of its position in the document tree, making it superior to em for consistency. [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Pixel scale — fixed sizing per element (e.g. h1 40px, h2 30px, p 16px). [S1]
  • Multiplier base — set a base size on body/html (16px) and express element sizes as em/rem multipliers (2.5em ≈ 40px, 1.875em ≈ 30px, 1em ≈ 16px). [S1]
  • Viewport scaling — use vw so text scales with the browser window size. [S1]

📖 세부 내용 (Details)

The CSS font-size property is used to specify the size of the text/font, emphasizing proper semantic HTML usage for headings and paragraphs. [S1]

Unit types [S1]

  • Absolute sizes: px (pixels) offer fixed, precise control; keyword sizes are xx-small, x-small, small, medium, large, x-large, xx-large.
  • Relative sizes: em (relative to parent's font size), rem (relative to root <html> font size), % (relative to parent), and smaller/larger (adjust relative to parent).

Selection guidance — use px for fixed control (though not ideal for responsive design); employ em or rem for scalable, accessible designs; apply % for parent-based adjustments. [S1]

Pixels approach — h1 at 40px, h2 at 30px, p at 16px. [S1]

h1 {
  font-size: 40px;
}

h2 {
  font-size: 30px;
}

p {
  font-size: 16px;
}

Em approach — body base 16px; h1 at 2.5em (40px); h2 at 1.875em (30px); p at 1em (16px). [S1]

body {
  font-size: 16px;
}

h1 {
  font-size: 2.5em;
}

h2 {
  font-size: 1.875em;
}

p {
  font-size: 1em;
}

Rem approach — html set to 16px; same multipliers as the em approach. [S1]

html {
  font-size: 16px;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.875rem;
}

p {
  font-size: 1rem;
}

Viewport width (vw) — h1 at 10vw; p at 5vw, scaling with browser window resizing. [S1]

h1 {
  font-size: 10vw;
}

p {
  font-size: 5vw;
}

Key concept: rem always refers to the font-size of the <html> element, regardless of its position in the document tree, making it superior to em for consistency. [S1]

🛠️ 적용 사례 (Applied in summary)

The page's examples apply font-size with four unit strategies (px, em, rem, vw) to headings and paragraphs, demonstrating fixed vs. relative vs. viewport-based sizing. No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

Multiplier base pattern (language: CSS):

html {
  font-size: 16px;
}

h1 {
  font-size: 2.5rem;
}

Viewport scaling pattern:

h1 {
  font-size: 10vw;
}

⚖️ 비교 및 선택 기준 (Comparison & decision criteria)

  • px — fixed, precise control; not ideal for responsive design. [S1]
  • em — relative to the parent's font size; can compound through nesting. [S1]
  • rem — relative to the root <html> font size; preferred for consistency because it ignores position in the document tree. [S1]
  • % — relative to the parent; good for parent-based adjustments. [S1]
  • vw — scales with browser window size for fluid/responsive text. [S1]

Guidance: use px for fixed control, em or rem for scalable accessible designs, and % for parent-based adjustments. [S1]

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

No contradictions found in the source.

검증 상태 및 신뢰도

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

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

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