GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — CSS nesting - CSS | MDN

CSS nesting

The CSS nesting module defines a syntax for nesting selectors, providing the ability to nest one style rule inside another, with the selector of the child rule relative to the selector of the parent rule.

CSS nesting is different from CSS preprocessors such as Sass in that it is parsed by the browser rather than being pre-compiled by a CSS preprocessor.

CSS nesting helps with the readability, modularity, and maintainability of CSS stylesheets. It also potentially helps reduce the size of CSS files, thereby decreasing the amount of data downloaded by users.

Reference

Selectors

  • & nesting selector

Guides

Using CSS nesting

Explains how to use CSS nesting.

CSS nesting at-rules

Explains how to nest at-rules.

CSS nesting and specificity

Explains the differences in specificity when nesting CSS.

Related concepts

  • Selectors and combinators
  • Pseudo-classes
  • CSS preprocessor

Specifications

Specification
CSS Nesting Module Level 1

See also

  • Specificity
  • CSS cascading and inheritance module
  • CSS selectors module

Help improve MDN

Learn how to contribute

This page was last modified on Nov 18, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.