How to do Nesting in SASS

Answer

SASS allows the nested code to be inserted within each other. where as 

CSS does support logical nesting, but the code blocks themselves are not nested. 

 

table.hl {
  margin: 2em 0;
  td.ln {
    text-align: right;
  }
}
 
li {
  font: {
    family: serif;
    weight: bold;
    size: 1.3em;
  }
}

Would compile to:

table.hl {
  margin: 2em 0;
}
table.hl td.ln {
  text-align: right;
}
 
li {
  font-family: serif;
  font-weight: bold;
  font-size: 1.3em;
}

More complicated types of nesting including Namespace nesting and parent references are discussed in the Sass documentation

All sass Questions

Ask your interview questions on sass

Write Your comment or Questions if you want the answers on sass from sass Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---