Files
freeCodeCamp/guide/chinese/certifications/front-end-libraries/sass/nest-css-with-sass/index.md
2018-10-16 21:32:40 +05:30

44 lines
604 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Nest CSS with Sass
localeTitle: 使用Sass嵌套CSS
---
## 使用Sass嵌套CSS
* 在Sass中嵌套CSS规则允许定义层次结构选择器。
* 您可以通过嵌套CSS规则来组织样式表。
## 例
```sass
.title{
strong{}
em{}
}
// This will be compiled into:
.title{}
.title strong{}
.title em{}
```
## 提示1
* 您可能想要在第4行更改“}”的位置。
## 解
```sass
<style type='text/sass'>
.blog-post {
h1 {
text-align: center;
color: blue;
}
p {
font-size: 20px;
}
}
</style>
```