tags:

views:

171

answers:

2

i use a parent div with three child divs ,

<div id="parentDiv">
    <div id="PagerUp" class="pager">

     </div>
    <div id="ResultsDiv">

    </div>
    <div id="PagerDown" class="pager">

    </div>
</div>

But what i get is this http://img132.imageshack.us/img132/5923/floatingdivs.jpg

How to float all those divs to center.... Hint:I dint apply any css...

+1  A: 

Try this:

#parentDiv {
  width: 600px; /* or whatever width you specify */
  margin:0px auto;
}

.

Update:

Try giving margins to the pagers:

#PagerUp, #PagerDown
{
      width: 600px; /* or whatever width you specify */
      margin:0px auto;
}

Or you can do like this too:

#PagerUp, #PagerDown
{
   width: 600px; /* or whatever width you specify */
   margin-left:100px;  /* adjust value accordingly */
   margin-right:100px;  /* adjust value accordingly */
}
Sarfraz
@sarfraz that didnt work...
Pandiya Chendur
@Pandiya Chendur: Could you elaborate little more what exactly you are looking for?
Sarfraz
@sarfraz i want then to look like this http://img151.imageshack.us/img151/5594/centerddiv.jpg
Pandiya Chendur
@sarfraz pager div postion in center above and below resultsdiv
Pandiya Chendur
@Pandiya Chendur: please see my updated answer.
Sarfraz
@sarfraz now i get the point margins do the trick thanks...
Pandiya Chendur
@Pandiya Chendur: That's good news then :)
Sarfraz
A: 

If you want to center all those div, then you must center their parent. Use margin:0 auto on #parentDiv

Riccardo Galli
@Riccardo that didnt seem to work for me..
Pandiya Chendur