开发者

Nested pseudoclasses in Less css

I am trying to use LESS CSS to write my CSS but i got a problem with nested pseudoclasses I

.class1 { 
        &:nth-of-type(2n) {  
            .class2{  
            } 
     开发者_开发问答   } 
    }

the output is:

.class1.class2:nth-of-type(2n) {}

but I want to have this:

.class1:nth-of-type(2n) .class2{}

Any ideas?


Not an issue. You probably had a version of LESS CSS that did not produce the correct code. Try the online less converter and see that it works fine. Here is what I get:

(in)

.class1 { 
  &:nth-of-type(2n) {  
    .class2{  
      x:1;
    } 
  } 
}

(out)

.class1:nth-of-type(2n) .class2 {
  x: 1;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜