Is there a way to apply styles to all the elements of a class directly without having to write like this:
.element-wrapper .coin-box{
margin: 10px;
float: left;
}
.element-wrapper .platform{
margin: 10px;
float: left;
}
.element-wrapper .goomba{
margin: 10px;
float: left;
}
you can use * selector, for example:
.element-wrapper *{
margin: 10px;
float: left;
}
Descendent selectors are very similar to child selectors, except that child selectors only select immediate descendents; descendent selectors select matching elements anywhere in the element hierarchy, not just direct descendents. Let's look at what this means more carefully.
CSS:
.element-wrapper > *
{
margin: 10px;
float: left;
}
It will work more consistently :-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With