Centering a percent-based div

Posted by Sarfraz on Stack Overflow See other posts from Stack Overflow or by Sarfraz
Published on 2010-04-12T17:53:12Z Indexed on 2010/04/12 18:02 UTC
Read the original article Hit count: 434

Filed under:
|
|
|
|

Hello,

Recently, a client asked that his site be percent-based rather than pixel-based. The percent was to be set to 80%. As you guys know, it is very easy to center the container if it is pixel-based but how do you center a percent-based main container?

#container
{
  width:80%;
  margin:0px auto;
}

That does not center the container :(

© Stack Overflow or respective owner

Related posts about css

Related posts about html