0

I spend the whole afternoon searching, trying many ways but they all don't work. What I want to do is align the div with id="container" (which contain my drop-down menu) to the center of the page.
Here's my code: http://jsbin.com/ilupuf/2/

sonlexqt
  • 6,011
  • 5
  • 42
  • 58
  • It's clearing the floats issue, refer my answer http://stackoverflow.com/questions/12871710/why-clear-both-css/12871734#12871734 – Mr. Alien Jul 16 '13 at 11:43

3 Answers3

0

Remove float: left; and then it centers nicely.

Kevin Lynch
  • 24,427
  • 3
  • 36
  • 37
0

Dante, take a look at this:

http://jsbin.com/ilupuf/23/edit

You just have to adjust the menu's width - you didn't specify whether it should have fixed width or not, so I assumed that it doesn't have to stretch to fit the contents.

biphobe
  • 4,525
  • 3
  • 35
  • 46
-1
body {
    margin: 0 auto;
    max-width: 1024px;
    min-width: 800px;
    text-align: center;
}

add this class in the css

웃웃웃웃웃
  • 11,829
  • 15
  • 59
  • 91
Sudhir
  • 13
  • 3