How can I make a class work recursively on all the child elements in CSS?
Hello!
I would like to create a class .block in css which makes all the child elements of the element in question act like block elements. So that every child element ends up at a new row. I allready know the code to make one element act like a block element, “display: block;”
But setting a div for example to the class .block will only cause the div itself to act like a block element (which it allready does btw), not the child elements. Is there a way to make the child elements adopt the properties of the class, or make the class act recursively in the ocject tree until a new class is specified?

Leave a Reply
You must be logged in to post a comment.