[ Jump to content. Jump to navigation. ]

Tables and font sizes in Mozilla

Wed 12 Jun 2002 21:42:41

We're used to font-sizes not getting carried into table cells, so that when coding CSS for tables-based layouts, designers declare font-sizes separately for the body and td tags.

That seems to have changed with Mozilla 1.x. For example, with the stylesheet...

body { font-size: smaller }
td { font-size: smaller }

... one would expect IE or Netscape to show text of the same size in and out of table cells. Mozilla, however, carries the "smaller" property into tables, so that the extra font-size declaration for td becomes annoying and redundant, displaying an even smaller text size.

This poses a problem for people trying to make cross-browser table-based layouts using relative font-size keywords, percentages, or ems. The solution? Either use pixel-sizes, or don't declare font-sizes at all. Oh, the horror!

(CSS layouts which aren't dependent on tables seem to sound more and more sensible everyday, don't they?)

Categories:
Tags:

1 Comment

Except for the fact that tables are so much easier to achieve in so many circumstances. I would officially put on the sad face for Mozilla save for the fact that I never put font-sizing in the body element anyway... *whew*