递归 CSS 选择器?

Recursive CSS selector?

我想用一个 class 定位一个 div,它在另一个 div 和另一个 class 中,这基本上是我想要做的:

.footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    /* Set the fixed height of the footer here */
    height: 60px;
    background-color: #2f2f2f;
    .container {
        width: auto;
        max-width: 680px;
        padding: 0 15px;

        .text-muted {
            margin: 20px 0;
        }
    }
}

但是我不能将 class 选择器放在其他选择器中,我可以开始使用 LESS 或 SASS 或其他类型的 CSS 框架吗?

此致,

你可以使用纯 css:

.footer {
position: sticky;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #2f2f2f;
}

.footer .container {
    width: auto;
    max-width: 680px;
    padding: 0 15px;
}

.footer .container .text-muted {
        margin: 20px 0;
}