SCSS: getting started

Lesson 06 · 10 min

The parent &

& is the selector you're writing inside. .btn { &:hover } → .btn:hover.

10 minLesson 6 of 8Practice includedAsk AI on any point

& substitutes the parent. &:hover, &.is-on, & + &. You can do &__title in BEM: .card { &__title {} } → .card__title. Don't write & .child where .child with a proper class is enough — you get extra nesting.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.