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;
}
}
}
}
Written by Fendy Kusuma Wardhana
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#