如何使用scss为子选择器应用样式

时间:2018-02-16 13:27:23

标签: css sass

如何在没有深度嵌套的情况下以更简单的方式使用scss为第n个嵌套子项应用样式

1 个答案:

答案 0 :(得分:0)

你的意思是:

.class {
    &:nth-child(odd) {
        // Style here...
    }
}

更新

根据你的评论,你需要把你的CSS写成

.contaier.desc {
    .hello2 { 
        .hello3 { 
            background-color-red;
        }
    }
}
相关问题