|
Posted by dorayme on 12/29/07 01:33
In article
<de3d8289-b82c-4127-a708-b6fe58a52c03@i12g2000prf.googlegroups.co
m>,
jeremy <jeremychapman@gmail.com> wrote:
> Generally, I want all html on my page to have a size of 10pt, so I
> have a style set:
>
> body, div, input, select, span, td, th, legend, textarea, a, a:hover
> {
> font-size: 10pt;
> }
>
> I use this because I've found (at least with IE which I must support)
> that not all elements inherit the font size so I set the size
> explicitely explicitly. This worked well until I needed a table in my
> page with 8pt text in the cells.
>
> I set the size in the style of the table and nothing worked. is there
> any way to get this to work by setting the table style, and not the
> individual cells? I find it strange that the cell font size doesn't
> inherit from the table style and instead uses the global style.
Let me talk about good browsers. Tell me if it does not apply to
IE.
There is nothing "global" about your instruction to td. It is
very specific. If you tell table one thing and you tell td
another, surely you would expect the cell to listen to you rather
than to listen to its ancestor. You as author are like a god and
if you speak directly to the descendant, it obeys you.
Lets simplify and exaggerate:
body, td {font-size: 50pt;}
is equivalent to
body {font-size: 50pt;}
td {font-size: 50pt;}
(not much global about the latter.)
If you now set
table {font-size: 5pt;} and have a table heading in it you will
see text in the cell huge and the heading tiny. The only thing
that listens to the table font-size is the th in this. What else
should it listen to in the circumstances? The td knows what to do
because you have informed it directly here.
In other words, set td directly to your preferred font-size (you
can remove it from your list or simply add on the next line
td {font-size: 8pt;}
--
dorayme
[Back to original message]
|