CSS Sass Basics Improve Your Workflow with Sass Write Nested Selectors

Alexandra Velez
seal-mask
.a{fill-rule:evenodd;}techdegree
Alexandra Velez
Front End Web Development Techdegree Student 9,313 Points

Why isn't it accepting the nested element and & in this challenge?

It appears that everything is spelled correctly, nested well, yet it's not accepting it as a valid response.

Where's the error in the code?

Thanks in advance!

style.scss
.banner {
  padding: 1em;
  background-color: lightgrey;

  .button {
     font-size:1.5em;
  }

}

.icn {
  font-size: 1.25em;

  &.icn-success {
     color: green;
    }

  }

1 Answer

Steven Parker
Steven Parker
204,006 Points

The "&" symbol represents the current rule selector.
So within the rule for ".icn", the code "&.icn-success" would expand to ".icn.icn-success".

To create the selector ".icn-success", you would just write "&-success".