I have the same class several times in the same DOM (as normal), and I'd like to apply a padding to the first element in the DOM using that class. ( I am using sass).
So far I tried>
.myclass{
&:first-of-type{
padding-top: 50px;
}
}
and
.myclass{
&:nth-child(1){
padding-top: 50px;
}
}
and
.myclass{
&:nth-of-type(1){
padding-top: 50px;
}
}
and only the last piece of code seems to have any effect on the DOM adding padding to ALL elements using .myclass (and not only the first one).
Any idea about what I doing wrong?