Problem with CSS DIV align

Posted by Sergio on Stack Overflow See other posts from Stack Overflow or by Sergio
Published on 2010-04-26T18:59:35Z Indexed on 2010/04/26 19:03 UTC
Read the original article Hit count: 262

Filed under:
|

If the doctype declaration is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> what is the best way for horizontal alignment of the DIV's like these:

<div id="outer"><div id="inner">Some text</div></div>

The CSS is:

#outer{ border-top:1px dotted #999; background-color: #F4F4F4; width:100%;}
#inner{ width:500px;border:1px solid #F00; margin:auto;}

The thing that I want to do is the inner DIV align at center (horizontally) inside the outer DIV. This CSS working fine if the doctype declaration is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

© Stack Overflow or respective owner

Related posts about html

Related posts about css