The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Target every element inside another element
Hi – have another question.
Normally, when designers want to set a simple CSS reset, they’d do something like this:
I was wondering if I could do something like this:
What I’m trying to do is remove the margin/padding of every element inside a particular div, but not anything else outside of the div.
Is this possible?
Yep pretty sure that will work. Have you tried it?
Is that seriously the correct syntax? Damn, I’m good. :D Yes, it worked. Thanks.
Good work. I love using it for things like this: #content > *:first-child {margin-top:0;}
It has many great uses that little asterisk.