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