【问题标题】:Can I use the parent selector for multi-classed elements?我可以将父选择器用于多类元素吗?
【发布时间】:2013-02-25 03:05:08
【问题描述】:

我正在将一些 css 文件转换为 Sass。 documentation 对一件事有点不清楚,我可以像这样使用& 父引用吗:

.css

.class {
  background:red;
}

.class.otherclass{
  background:green;
}

.scss

.class {
  background:red;

  &.otherclass{
    background:green;
  }
}

【问题讨论】:

  • @cimmanon 哪个空间?
  • 我回复的评论已被删除,他们认为您的意思是 .class .otherClass 而不是 .class.otherClass

标签: css sass


【解决方案1】:

是的,你可以

Here's the relevant documentation.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-14
    • 1970-01-01
    • 2017-01-19
    • 2017-09-01
    • 2012-04-25
    • 1970-01-01
    • 1970-01-01
    • 2012-11-13
    相关资源
    最近更新 更多