I used to write a simple code as:
.grandparent {}
.parent {}
.child {}
with
<div class="grandparent">
<div class="parent">
<div class="child">
</div>
</div>
</div>
But with a use of selectors now, the above code could be written as:
.name {}
.name > div {}
.name > div > div {}
Now, sorry if this sounds dumb, but what is the difference between these two codes? When should I use class names and when selectors? Is there any difference in speed performance? Ty