position: relative;&::after {
content: ' ';
display: block;
clear: both;
}
}
}Herewe’venestedstylesfor::afterinsideadeclarationblockforul,whichitself
isnestedinsideanavdeclarationblock.Whencompiled,weendupwiththefol-
lowingCSS:
nav > ul {
height: 1em;
overflow: hidden;
position: relative;
}
nav > ul::after {
content: ' ';
display: block;
clear: both;
}Let’slookataslightlymorecomplexexampleofnesting:
article {
color: #222;
margin: 1em auto;
width: 80%;&.news {
h1 {
color: #369;
font-size: 2em;[lang]{
font-style: italic;
}Preprocessors 335