Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
With Sass, we're able to nest selectors in the same visual hierarchy of our HTML. In this video, we'll look for areas in our code where it makes sense to nest rules.
When does it make sense to nest selectors?
When working with namespaced selectors:
.main {
&-heading {
...
}
&-title {
...
}
}
When/if the nested selectors rely on the parent's context. Navigations, for example:
.main-nav {
...
li {
...
}
a {
...
}
}
Quick Reference
Related Videos
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up