--- id: css-syntax title: "CSS Syntax" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["CSS rule", "CSS declaration", "selector and declaration block", "CSS property value", "CSS rule syntax"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "syntax"] raw_sources: ["https://www.w3schools.com/css/css_syntax.asp"] applied_in: [] github_commit: "" --- # [[CSS Syntax]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A CSS rule is made of a selector that points to the HTML element to style and a declaration block containing one or more `property: value;` declarations, separated by semicolons and surrounded by curly braces. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **A CSS rule has two parts** β€” a selector and a declaration block. [S1] - **Selector** β€” points to the HTML element you want to style. [S1] - **Declaration block** β€” contains one or more declarations separated by semicolons. [S1] - **Declaration** β€” includes a CSS property name and a value, separated by a colon. [S1] - **Punctuation** β€” multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Rule pattern** β€” `selector { property: value; property: value; }`. [S1] - **Declaration pattern** β€” each declaration pairs a property and a value with a colon: `property: value;`. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) A CSS rule consists of a **selector** and a **declaration block**. [S1] The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon. Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces. [S1] **Example** [S1] ```css p { color: red; text-align: center; } ``` In this example: [S1] - `p` is the selector (it targets HTML `

` paragraph elements). - `color` is a property, and `red` is its value. - `text-align` is a property, and `center` is its value. The rule above makes all paragraph text red and center-aligned. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The `p` rule above is the page's own applied example: a complete rule styling paragraph elements with `color` and `text-align`. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Basic CSS rule structure (language: CSS): ```css selector { property: value; property: value; } ``` Concrete example: ```css p { color: red; text-align: center; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.9 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Introduction]], [[CSS Selectors]], [[CSS Add Internal]] - **μ°Έμ‘° λ§₯락:** The grammar underlying every CSS rule; referenced whenever writing or reading any selector and declaration. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Syntax β€” https://www.w3schools.com/css/css_syntax.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Syntax" page (Astra wiki-curation, P-Reinforce v3.1 format).