I'm making a mobile website & I'm stuck in a problem. I have a main div
and inside it there are three div
's. Earlier I wanted it left aligned but now I want to align these three div
's to the center of the page. i.e. if the screen of the device is wide it should come to the center, right now it's left aligned.
I tried many ways but not able to get it. Here is the code & css I know the sizes should be in em's & not pixels; I'll fix that soon.
<div class="main-buttons">
<div class="box1"><a href="#"></a></div>
<div class="box2"><a href="#"></a></div>
<div class="box3"><a href="#"></a></div>
</div><!-- MAIN BUTTONS ENDS HERE -->
.main-buttons{ height:42px; padding:5px 10px 5px 10px; background-color:#FFFFFF; border-bottom:dotted 1px #7c7c7c;}
.box1 a { background-image:url(images/box1.jpg); height:42px; margin-right:6px; width:65px; }
.box2 a { background-image:url(images/box2.jpg); height:42px; margin-right:6px; width:65px; }
.box3 a { background-image:url(images/box2.jpg); height:42px; width:65px; }