DEV Community

Discussion on: CSS class to add margin for all child elements

Collapse
 
afif profile image
Temani Afif

you can use gap to do this: developer.mozilla.org/en-US/docs/W...

Collapse
 
ml318097 profile image
Mehul Lakhanpal

Thanks for pointing it out. But to add any other styles the universal selector would be better I guess. Anyways I'll just update the post.

Collapse
 
afif profile image
Temani Afif

You no more need any selector, a simple gap:12px applied to the flexbox container will do the job.

Thread Thread
 
ml318097 profile image
Mehul Lakhanpal

Yes I know. Its works the same way with css grids. I am saying if you need to apply styles other than that wont work.