递归CSS选择器?

时间:2016-06-29 10:47:04

标签: html css twitter-bootstrap less footer

我想将一个div作为另一个div的另一个div的目标,这基本上就是我想做的事情:

.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;
        }
    }
}

但是我不能把类选择器放在别人的内部,我应该开始使用LESS或SASS还是其他类型的CSS框架?

此致

1 个答案:

答案 0 :(得分:2)

你可以使用纯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;
}