J
Joey
Hello all,
I have been designing a site where the main content is enclosed in one
table, and that table needs to be centered (the centering is done by
using another container such as a div or table).
In the future we might change things so that all content is
left-aligned.
Okay, now obviously I do not want to "hardcode" all of the master
table/tr/td tags to align (for example td align="center" and td
align="left" on each page). I think this would be much better job for
CSS.
I think I should be able to code a CSS class that would handle the
alignment. This would obviously make things much more manageable.
Sounds good, right?...wrong! The problem with this is that IE
handles...
div { text-align:left; }
div { text-align:center; }
td { text-align:left; }
td { text-align:center; }
....with no problems. Everything aligns as expected.
However, when viewing the same page in Firefox, it ALWAYS puts the
content along the left side of the page. The only exception is when I
use a table for the alignment instead of a div and then "hardcode" td
align="center" into the page.
My question here is: how can I tell Firefox to center my content, by
using CSS?
I have read some about specifying margin as auto?...that doesn't work
here. Firefox does not recognize the "text-align" style for some
reason.
If you guys have any ideas about this, please post them here. This
seems like something that should be extremely easy to fix...if I only
know what to code.
Thanks in advance for your help.
I have been designing a site where the main content is enclosed in one
table, and that table needs to be centered (the centering is done by
using another container such as a div or table).
In the future we might change things so that all content is
left-aligned.
Okay, now obviously I do not want to "hardcode" all of the master
table/tr/td tags to align (for example td align="center" and td
align="left" on each page). I think this would be much better job for
CSS.
I think I should be able to code a CSS class that would handle the
alignment. This would obviously make things much more manageable.
Sounds good, right?...wrong! The problem with this is that IE
handles...
div { text-align:left; }
div { text-align:center; }
td { text-align:left; }
td { text-align:center; }
....with no problems. Everything aligns as expected.
However, when viewing the same page in Firefox, it ALWAYS puts the
content along the left side of the page. The only exception is when I
use a table for the alignment instead of a div and then "hardcode" td
align="center" into the page.
My question here is: how can I tell Firefox to center my content, by
using CSS?
I have read some about specifying margin as auto?...that doesn't work
here. Firefox does not recognize the "text-align" style for some
reason.
If you guys have any ideas about this, please post them here. This
seems like something that should be extremely easy to fix...if I only
know what to code.
Thanks in advance for your help.