I have four divs contained in another div, and I want the four inner divs to be centered.
I have used float: left on the four divs so that they are horizontally aligned.
CSS:
<style>
.square //inner divs
{
float: left;
margin:1pt;
width:72pt;
height:72pt;
}
.container //outer divs
{
text-align:center;
width:450pt;
height: 80pt;
}
</style>
and HTML:
<div class = "container">
<div class = "square">...</div>
<div class = "square">...</div>
<div class = "square">...</div>
<div class = "square">...</div>
</div>
How can I center the divs inside the container?
The number of inner divs can be variable.