--- id: css-radial-gradients title: "CSS Radial Gradients" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["radial-gradient", "CSS radial gradient", "repeating-radial-gradient", "circle gradient", "ellipse gradient"] 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", "gradients", "radial-gradient", "background-image"] raw_sources: ["https://www.w3schools.com/css/css3_gradients_radial.asp"] applied_in: [] github_commit: "" --- # [[CSS Radial Gradients]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A radial gradient (`radial-gradient()`) is defined by its center and spreads color stops outward; by default it is an ellipse, sized `farthest-corner`, centered, and it is applied through the `background-image` property. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Radial = defined by a center point** β€” a radial gradient is defined by its center and radiates the color transition outward. [S1] - **At least two color stops** β€” like a linear gradient, a radial gradient must have at least two color stops. [S1] - **Default shape, size, and position** β€” the defaults are shape = `ellipse`, size = `farthest-corner`, position = `center`. [S1] - **Color-stop spacing** β€” color stops can be evenly spaced (the default) or assigned percentages to space them differently. [S1] - **Shape and size are controllable** β€” shape can be `circle` or `ellipse`, and size keywords control how far the gradient extends. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Even-stops pattern** β€” `radial-gradient(color1, color2, color3)` for default evenly spaced stops. [S1] - **Spaced-stops pattern** β€” assign percentages (`color 5%`, `color 15%`...) to control stop placement. [S1] - **Shape pattern** β€” prepend `circle` (or `ellipse`) to force the shape. [S1] - **Size-keyword pattern** β€” use `closest-side`/`farthest-side`/`closest-corner`/`farthest-corner` plus `at ` to control extent and center. [S1] - **Repeating pattern** β€” `repeating-radial-gradient()` repeats a percentage-defined sequence. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Syntax** [S1] ``` background-image: radial-gradient(shape size at position, start-color, ..., last-color); ``` By default the shape is `ellipse`, the size is `farthest-corner`, and the position is `center`. **Evenly Spaced Color Stops (this is default)** [S1] ```css #grad { background-image: radial-gradient(red, yellow, green); } ``` **Differently Spaced Color Stops** [S1] ```css #grad { background-image: radial-gradient(red 5%, yellow 15%, green 60%); } ``` **Set Shape** [S1] The shape parameter defines the shape. It can take the value `circle` or `ellipse`; the default value is `ellipse`. This example uses `circle`: ```css #grad { background-image: radial-gradient(circle, red, yellow, green); } ``` **Use of Different Size Keywords** [S1] The size parameter defines the size of the gradient. It can take four values: `closest-side`, `farthest-side`, `closest-corner`, and `farthest-corner`. ```css #grad1 { background-image: radial-gradient(closest-side at 70% 60%, red, yellow, black); } #grad2 { background-image: radial-gradient(farthest-side at 70% 60%, red, yellow, black); } ``` **Repeating a radial-gradient** [S1] The `repeating-radial-gradient()` function is used to repeat radial gradients. ```css #grad { background-image: repeating-radial-gradient(red, yellow 10%, green 15%); } ``` ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own demonstrations (the `#grad`, `#grad1`, and `#grad2` elements showing even/spaced stops, circle shape, size keywords, and repeating gradients) serve as the applied examples. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Default radial gradient (language: CSS): ```css #grad { background-image: radial-gradient(red, yellow, green); } ``` Circle with positioned size keyword: ```css #grad1 { background-image: radial-gradient(closest-side at 70% 60%, red, yellow, black); } ``` Repeating radial gradient: ```css #grad { background-image: repeating-radial-gradient(red, yellow 10%, green 15%); } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **`circle` vs `ellipse`** β€” `ellipse` is the default and stretches to the box's aspect ratio; choose `circle` when a perfectly round transition is wanted. [S1] - **Size keywords** β€” `closest-side`, `farthest-side`, `closest-corner`, and `farthest-corner` decide where the gradient's ending shape meets the box; `farthest-corner` is the default. [S1] - **Even vs differently spaced stops** β€” omit percentages for evenly spaced stops; supply percentages to bias where each color sits. [S1] - **Single vs repeating** β€” use `repeating-radial-gradient()` when the percentage sequence should tile outward. [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.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Linear Gradients]], [[CSS Conic Gradients]], [[CSS Box Shadow]] - **μ°Έμ‘° λ§₯락:** Referenced whenever a center-out color background (spotlight/glow effect) is needed via `background-image`. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Radial Gradients β€” https://www.w3schools.com/css/css3_gradients_radial.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Radial Gradients" page (Astra wiki-curation, P-Reinforce v3.1 format).