Let's suppose there are many divs inside a div:
<div id="#container">
div div div div
</div>
the inner divs can be next to each other even. Now I want to have 5px padding between all of then, just like cellspacing
of table
.
you would do something like:
#container div
{
margin: 0px 5px 5px 0px;
}
or for only the immediate children:
#container > div
{
margin: 0px 5px 5px 0px;
}
if you want the divs to go side-by-side you have to float them:
#container div
{
float:left;
clear:none;
margin: 0px 5px 5px 0px;
}