css - LESSCSS check if closest parent has class -


i use:

.first{     .second{         .third{             .between_second_and_third & {                 /* rules */             }         }     } } 

and in end have:

.between_second_and_third .first .second .third {/* rules */} 

but want:

.first .second .between_second_and_third .third {/* rules */} 

how can it?


first, & marker refer current parent selector (as mentionned here)

that's why you've got final statement cause defined that:

.first{     .second{         .third{             .between_second_and_third .first .second .third {                 /* rules */             }         }   } 

you have nest between_second_and_third class between... .second , .third class declarations this:

.first{     /* first rules */     .second{        /* rules second */        .between_second_and_third {           /* rules between */           .third{            /* other rules */                     }     } } 

this declaration render lines of css code:

.first { /* first rules */ } .first .second { /* rules second */ } .first .second .between_second_and_third {/* rules between */} .first .second .between_second_and_third .third {/* other rules */} 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -