首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >递归CSS选择器?

递归CSS选择器?
EN

Stack Overflow用户
提问于 2016-06-29 10:47:03
回答 1查看 1.3K关注 0票数 1

我想用另一个类定位一个div和另一个类,这基本上就是我想要做的:

代码语言:javascript
复制
.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;
        }
    }
}

但是我不能将类选择器放在其他类中,我应该开始使用更少的、更少的或者其他类型的CSS框架吗?

致以敬意,

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-29 10:49:45

您可以使用纯css实现这样的功能:

代码语言:javascript
复制
.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;
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38097356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档