Google News
logo
Less - Interview Questions
What is the role of nesting in Less programming?
The nesting is used to make the code simple, clean and Less complicated by allowing it to follow some visual hierarchy. For example nesting of classes can be done in Less programming.
 
For example :
.container {  
   h1 {  
      font-size: 25px;  
      color:#E45456;  
   }  
   p {  
      font-size: 25px;  
      color:#3C7949;  
   }  
  
   .myclass {  
      h1 {  
         font-size: 25px;  
         color:#E45456;  
      }  
      p {  
         font-size: 25px;  
         color:#3C7949;  
      }  
   }  
} 

 

 
In the above Less document example of nesting myclass is the subclass of container class.
Advertisement