table td font size inheritance

J

jeremy

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.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Fri, 28 Dec 2007 23:13:04 GMT
jeremy scribed:
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.

Did you remove the "td" from the main (above) style list?

I can make a lot more guesses but without having some data to work with...
 
R

Rob Waaijenberg

jeremy schreef:
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.


If I understand correctly, you now have this:

body, div, input, select, span, td, th, legend, textarea, a, a:hover
{
font-size: 10pt;
}

table
{
font-size: 8pt;
)


Right?
 
M

Michael Fesser

..oO(jeremy)
Generally, I want all html on my page to have a size of 10pt, so I
have a style set:

You don't want to use pt on a web page. Use em or %.
body, div, input, select, span, td, th, legend, textarea, a, a:hover
{
font-size: 10pt;
}

body {
font-size: ...
}

is enough on a properly built site.
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.

Make sure your pages are rendered in standards mode, not in quirks mode.
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.

It's a known IE bug in quirks mode.

Micha
 
D

dorayme

<[email protected]
m>,
jeremy said:
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;}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top