Last Updated: February 25, 2016
·
7.084K
· danzkusuma

SASS selector - select only child from parent

If we have CSS selector like this :

ul > li {
    display: block;
}
ul > li > a {
    display: inline-block;
}
ul > li > a:hover{
    text-decoration: underline;
}

We would simply say in SASS selector solution by this way:

ul{
    > li{
        display: block;
        > a{
            display: inline-block;
            &:hover{
                 text-decoration: underline;
            } 
        }
    }
}