I want a gap of say 30px; between all children of my div. E.g if I have:
...
-
Probably the easiest way is this:
#parent * {
margin-bottom: 30px;
}
or
#parent * {
margin: 15px 0;
}
Keep in mind, though, that this will get everything in #parent
, including things inside the p
and div
tags. If you want just the direct children, you can use #parent > *
(this is call the direct descendent selector) instead.
Keep in mind,
is an inline element by default, so you might need to do:
#parent img {
display: block;
}
for it to use the margins.