Use Margin Auto and Center to center Float Left Div

Posted by Yan Cheng CHEOK on Stack Overflow See other posts from Stack Overflow or by Yan Cheng CHEOK
Published on 2010-03-13T17:05:29Z Indexed on 2010/03/13 17:15 UTC
Read the original article Hit count: 242

Filed under:

I know this question had been asked many times.

http://stackoverflow.com/questions/1740587/float-a-div-to-center

However, I follow their suggestion :

<center>
  <div style="margin : auto">
    <a href="#" style="float: left; margin-right: 10px;">Menu Item 1</a>
    <a href="#" style="float: left; margin-right: 10px;">Menu Item 2</a>
    <a href="#" style="float: left; margin-right: 10px;">Menu Item 3</a>
  </div>
</center>

By using "Center" and "Margin Auto", I still unable to center the menu item.

© Stack Overflow or respective owner

Related posts about css