在LessCSS中选择祖父母的子元素

时间:2015-07-26 12:32:07

标签: css less

据我所知,在LessCSS添加的功能允许我们选择父元素。 这是一个例子。

public partial class StudentReport : DbMigration
{
    public override void Up()
{
CreateTable(
    "dbo.StudentReport",
    c => new
    {
    Id = c.Guid(nullable: false, identity: true),
    StudentReportId = c.Guid(),
    RollNumber = c.String(),
    StudentType = c.String(),
    })
    .PrimaryKey(t => t.Id)
    .ForeignKey("dbo.Student", t => t.Id)
    .Index(t => t.Id);
}

输出将是。

.header {
  .menu {
    border-radius: 5px;
    .no-borderradius & {
      background-image: url('images/button-background.png');
    }
  }
}

但是,如果我想成为这样的输出怎么办?是否有可能。

.header .menu {
  border-radius: 5px;
}
.no-borderradius .header .menu {
  background-image: url('images/button-background.png');
}

感谢您的关注。

0 个答案:

没有答案