[thelist] Horizontal element alignment with CSS1

rudy r937 at interlog.com
Fri Nov 9 12:44:19 CST 2001


> Can anybody enlighten me on how to effectively replace 'align=center'
> (in DIVs, H1s, TDs, etc.) with a CSS1 control? I've scoured all the
> references I have but could only find a 'text-align' property, which only
> seems to apply to text within an element rather than the element itself.

hi paul

you've pretty much stumbled on it

throw yer stuff into a div which has text-align:center

watch out for inheritance, though -- if you have a paragraph in such a div,
not only will the p be centered in the div (taking into account margins and
padding), but the text in each line of the p may be centered too, so you
then have to turn around and give text-align:left back to the p... does
this make sense?

oh, and don't forget to test in all browsers...  [sigh]


rudy





More information about the thelist mailing list