diff --git a/files/en-us/web/css/css_nesting/using_css_nesting/index.md b/files/en-us/web/css/css_nesting/using_css_nesting/index.md index cb758671e08ed07..c021f2fc5b68fdc 100644 --- a/files/en-us/web/css/css_nesting/using_css_nesting/index.md +++ b/files/en-us/web/css/css_nesting/using_css_nesting/index.md @@ -230,15 +230,15 @@ In this example the `&` nesting selector is used to create compound selectors to ```html
-

Notice

+

Notice

Lorem ipsum dolor sit amet consectetur adipisicing elit.

-

Warning

+

Warning

Lorem ipsum dolor sit amet consectetur adipisicing elit.

-

Success

+

Success

Lorem ipsum dolor sit amet consectetur adipisicing elit.

@@ -258,7 +258,7 @@ Styles for the `.notices` to create a column using {{cssxref('CSS_flexible_box_l } ``` -This CSS uses nesting to create compound selectors. The top-level selector defines the basic styles for an element with `class="notice"`. The `&` nesting selector is then used to create compound selectors for elements with either `class="notice warning"` or `class="notice success"`. +In the CSS code below, nesting is used to create compound selectors both with and without `&`. The top-level selector defines the basic styles for elements with `class="notice"`. The `&` nesting selector is then used to create compound selectors for elements with either `class="notice warning"` or `class="notice success"`. Additionally, the use of nesting to create compound selectors without explicitly using `&` can be seen in the selector `.notice .notice-heading:before`. ```css .notice { @@ -269,8 +269,8 @@ This CSS uses nesting to create compound selectors. The top-level selector defin background-color: #ffc107; color: black; padding: 1rem; - h2:before { - /* same as `.notice h2:before` */ + .notice-heading:before { + /* equivalent to `.notice .notice-heading:before` */ content: "ℹ︎ "; } &.warning { @@ -278,8 +278,8 @@ This CSS uses nesting to create compound selectors. The top-level selector defin background-color: #d81b60; border-color: #d81b60; color: white; - h2:before { - /* equivalent to `.notice.warning h2:before` */ + .warning-heading:before { + /* equivalent to `.notice.warning .warning-heading:before` */ content: "! "; } } @@ -288,8 +288,8 @@ This CSS uses nesting to create compound selectors. The top-level selector defin background-color: #004d40; border-color: #004d40; color: white; - h2:before { - /* equivalent to `.notice.success h2:before` */ + .success-heading:before { + /* equivalent to `.notice.success .success-heading:before` */ content: "✓ "; } }