问题
我使用 Paul Irish 的 IE 条件注释技巧来针对不同版本的 IE。在 sass 中,当嵌套在另一个类中时,如何应用这些类之一。
.container{
// I need to put a ie8 specific style here which is a .ie8 class applied to the body
}
如果可能的话,我想避免这样做(能够将属性保持在一起很好):
.container{}
.ie8{
.container{}
}
这可能吗?
最佳答案
我相信这就是您正在寻找的 - 使用 SASS's parent selector "&" ,你可以这样做:
.container {
.ie8 & {
// ie8 specific styles here
}
}
关于css - Sass 中的 IE 条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23093810/