Centering of a div, but the normal CSS does not work

Posted by Jean on Stack Overflow See other posts from Stack Overflow or by Jean
Published on 2010-04-28T08:23:03Z Indexed on 2010/04/28 8:33 UTC
Read the original article Hit count: 219

Filed under:

Hello,

I want to center a div, but the general way is

#selector{position:relative;margin:0px auto;}

What exactly is wrong below

#crp{top:40%; position:absolute; margin:auto;}

The Div below is not nested but a standalone. The #crp is going to the extreme right.

<div id="crp">...something goes here....</div>

Thanks Jean

© Stack Overflow or respective owner

Related posts about css