table td font size inheritance

Discussion in 'HTML' started by jeremy, Dec 28, 2007.

  1. jeremy

    jeremy Guest

    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.
     
    jeremy, Dec 28, 2007
    #1
    1. Advertising

  2. jeremy wrote:

    > Generally, I want all html on my page to have a size of 10pt,


    Points are for printing, not web pages. Use percentages instead. See:
    http://k75s.home.att.net/fontsize.html

    > .. This worked well until I needed a table in my page with 8pt text in
    > the cells.


    8? Unreadable.

    --
    -bts
    -Friends don't let friends drive Vista
     
    Beauregard T. Shagnasty, Dec 28, 2007
    #2
    1. Advertising

  3. jeremy

    Neredbojias Guest

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

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Dec 29, 2007
    #3
  4. 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?


    --
    Rob
     
    Rob Waaijenberg, Dec 29, 2007
    #4
  5. ..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
     
    Michael Fesser, Dec 29, 2007
    #5
  6. jeremy

    dorayme Guest

    In article
    <
    m>,
    jeremy <> 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
     
    dorayme, Dec 29, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    6
    Views:
    11,094
    Peter Theill
    Nov 28, 2004
  2. dave richards
    Replies:
    2
    Views:
    616
    Paul Furman
    Feb 19, 2004
  3. Wongod
    Replies:
    2
    Views:
    715
  4. wial
    Replies:
    2
    Views:
    824
  5. mttc
    Replies:
    2
    Views:
    2,407
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page