66.4k views
5 votes
The following nested Sass would compile out to which selectors?

.button {
color: #ffffff;
background-color: #2980b9;
.page-contact & {
background-color: #e67e22;
}
}
a. .button{} and .button .page-contact{}
b. .button{} and . -contact{}
c. .button{} and .page-contact .button{}
d. .button{} and . {}

User DGreen
by
7.6k points

1 Answer

2 votes

Final answer:

The provided Sass code compiles to option c): .button{ } and .page-contact .button{ }.

Step-by-step explanation:

SASS is a popular CSS pre-processor. SASS code is processed by the program and compiled into CSS code, which can be used to style HTML elements.

SASS controls how it appears on the web page. It is compatible with all CSS versions.

The given nested Sass code you provided would compile to the following CSS selectors:

  • .button { color: #ffffff; background-color: #2980b9; }
  • .page-contact .button { background-color: #e67e22; }

In Sass, selectors can be nested inside other selectors. Sass can create any of the CSS combinators.

Therefore, the correct answer to which selectors it would compile out to is option c). .button{ } and .page-contact .button{ }.