레이아웃 및 CSS 더 많은 세부 정보 A2 · 공식 명세 플랫폼: 웹

CSS Nesting

CSS 중첩

CSS 중첩은 하나의 스타일 규칙을 다른 규칙 안에 쓰기 위한 내장 구문입니다. 브라우저는 여전히 선택자와 그 우선 순위를 읽을 때 CSS 규칙을 따릅니다.

당신은 이것을 이렇게 부를 수 있습니다 CSS Nesting네이티브 중첩중첩 스타일 규칙

작동 방식을 확인하세요

원본 작업 예제CSS 중첩

다른 예시

버튼은 `.button` 안에 `&:hover`, `&:focus-visible`, `@media (forced-colors: active)`를 중첩시킵니다. 이렇게 하면 여섯 개의 상태 규칙이 기본 규칙 근처에 유지됩니다. 리뷰에서는 버튼을 하나의 페이지 구조에 묶어버릴 수 있으므로 세 단계의 하위 선택자는 거부됩니다.

주요 부분

  1. 01상위 스타일 규칙
  2. 02중첩 선택자 또는 규칙(@at-rule)
  3. 03해결된 선택기

사용할 때

동일한 구성 요소에 속하는 상태, 버전 및 조건부 at-rule에는 한두 단계의 얕은 레벨을 사용하십시오.

다음 경우에는 사용하지 마세요

깊은 자식 체인과 정확한 DOM 구조에 대한 숨겨진 연결을 피하십시오. 네이티브 중첩은 항상 CSS 전처리기처럼 작동하지 않습니다.

코드에서 사용된 이름

nested style rules with &, relative selectors, and nested group rules

출시하기 전에

Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience.

복사 가능한 요청

Outcome:Complete the task with CSS 중첩 (CSS Nesting)。 User context:버튼은 `.button` 안에 `&:hover`, `&:focus-visible`, `@media (forced-colors: active)`를 중첩시킵니다. 이렇게 하면 여섯 개의 상태 규칙이 기본 규칙 근처에 유지됩니다. 리뷰에서는 버튼을 하나의 페이지 구조에 묶어버릴 수 있으므로 세 단계의 하위 선택자는 거부됩니다. Design concept to apply:CSS 중첩 (CSS Nesting)。 Why it fits:동일한 구성 요소에 속하는 상태, 버전 및 조건부 at-rule에는 한두 단계의 얕은 레벨을 사용하십시오. Do not use it when:깊은 자식 체인과 정확한 DOM 구조에 대한 숨겨진 연결을 피하십시오. 네이티브 중첩은 항상 CSS 전처리기처럼 작동하지 않습니다. Design requirements: Set the content order, shared design values, and reusable components. Define how the layout changes by screen size and state. Keep useful design choices separate from decoration. Inclusion and resilience: Check contrast, zoom, languages, themes, and reduced motion when needed. Do not use color or effects as the only way to show meaning. Acceptance criteria: The design stays clear on phones and desktops, at zoom, in every theme, and in all supported languages. Interactive states stay clear and consistent. Evidence and limits (evidence boundary):공식 문서라고 해도 초안, 출시 후보, 최종 버전일 수 있어요. 상태와 브라우저나 플랫폼 지원 여부를 꼭 확인하세요. Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.

이 요청을 확인하세요

Review how CSS 중첩 (CSS Nesting) is used now. Definition: CSS 중첩은 하나의 스타일 규칙을 다른 규칙 안에 쓰기 위한 내장 구문입니다. 브라우저는 여전히 선택자와 그 우선 순위를 읽을 때 CSS 규칙을 따릅니다. Release checks: Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.

A2
이 용어는 얼마나 공식적인가요?

공식 명세

출판된 공식 규격이 나열된 기술 범위에서 이 용어를 정의해요.

공식 문서라고 해도 초안, 출시 후보, 최종 버전일 수 있어요. 상태와 브라우저나 플랫폼 지원 여부를 꼭 확인하세요.

범위
소스가 포함하는 것만:정규 이름、정의、의미론、구현
문서 상태
초안
선택됨
2026-07-30

증거 출처 및 범위

권위 있는 출처 + 용어 참조 · W3C CSS Working Group · 초안 CSS Nesting Module Level 1 — Nesting style rules Nesting style rules 범위: 정규 이름、정의、의미론、구현 여기 역할: 직접 용어 참조 출처 범위: 정규 이름, 정의, 의미론, 구현 권위 있는 출처 · W3C CSS Working Group · 초안 CSS Nesting Module Level 1 범위: 정규 이름、정의、의미론、구현 여기 역할: 명시된 범위 안의 권위 출처 범위: 정규 이름, 정의, 의미론, 구현

직접 복사

브라우저가 이것을 복사할 수 없습니다. 아래 요청을 선택하고 직접 복사하세요.