【发布时间】:2019-09-22 17:20:17
【问题描述】:
我有以下代码:
article.featured {
h4 {
margin-bottom: 20px
}
:first-child {
height: 100%;
padding-top: 0;
padding-left: 0;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
.img {
@extend &;
}
}
:last-child {
padding-top: 0;
padding-right: 0
}
}
这是13:
@extend &;
问题是当我尝试编译这个样式表时,我得到以下错误:
Parent selectors aren't allowed here.
╷
10│ @extend &;
│ ^
╵
stdin 13:19 root stylesheet on line 10 at column 19
如何解决此错误并使用父 (&) 元素的属性扩展 .img 元素?
【问题讨论】: