Files
freeCodeCamp/guide/english/certifications/front-end-libraries/sass/nest-css-with-sass/index.md

54 lines
679 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Nest CSS with Sass
---
# Nest CSS with Sass
2018-10-12 15:37:13 -04:00
---
## Problem Explanation
2018-10-12 15:37:13 -04:00
- In Sass, nesting CSS rules allows to define hierarchy selectors.
- You can organize your style sheets by nesting CSS rules.
**Example:**
```scss
2018-10-12 15:37:13 -04:00
.title{
strong{}
em{}
}
// This will be compiled into:
.title{}
.title strong{}
.title em{}
```
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
- You may want to change the position of "}" at line 4.
---
## Solutions
<details><summary>Solution 1 (Click to Show/Hide)</summary>
```scss
2018-10-12 15:37:13 -04:00
<style type='text/sass'>
.blog-post {
h1 {
text-align: center;
color: blue;
}
p {
font-size: 20px;
}
}
</style>
```
</details>