The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Help centering a div Re: Help centering a div


use this css hack to center your div:

text-align: center

firstly, wrap your div to be centered with 2 more divs;

put that css hack to the outermost div;
also, specify the width of your page or use:

margin: 0 auto;

next wrapper div:

display: table;
margin: 0 auto;

your div:

display: table-cell;

and lastly, this:

html div.yours {
display: inline;