I'm trying to get some HTML pages to be more compliant and am starting off with simple stuff like removing align="center" in tables, etc.
However, I can't seem to get the effect I want using CSS. Stuff I've tried include
text-align:middle
vertical-align:middle
and the most suggested by designer friends
margin-left:auto; margin-right:auto; width: 100px
But under certain layouts or certain browsers (especially IE6) none seem to work. Is there a reliable way to do this using purely CSS and get it to work on most browsers?
EDIT:
I meant text-align: center;
. Typed it in a rush. The page already has a DOCTYPE but I'm not sure if it's appropriate.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">