CSS supports logical nesting, but the code blocks themselves are not nested. Less allows nesting of selectors inside other selectors. This makes inheritance clear and style sheets shorter.
#header { h1 { font-size: 26px; font-weight: bold; } p { font-size: 12px; a { text-decoration: none; &:hover { border-width: 1px; } } } }
The above code in Less would compile to the following CSS code:
#header h1 { font-size: 26px; font-weight: bold; } #header p { font-size: 12px; } #header p a { text-decoration: none; } #header p a:hover { border-width: 1px; }