font size as a percentage of the parent should get smaller shouldn't it?

Discussion in 'HTML' started by David Graham, Nov 5, 2003.

  1. David Graham

    David Graham Guest

    I am working my way through Eric Meyer's book on CSS. I have finished the
    first chapter on converting a table based design to CSS. I have uploaded the
    page

    http://p0c79.phpwebhosting.com/~p0c79/ch01projopy.html

    I would like to know why Eric has got the text in the middle of the footer
    to be a bit bigger than the rest of the text in the footer by doing the
    following

    tr#footer td {vertical-align: middle; font-size: 66%; border-top: 3px solid
    #EFE1D1;}
    tr#footer td#tg {font-size: 85%; text-align: center;}

    From what I've learnt in this group, such a declaration would make the
    center text 85% of 66% which should be even smaller than 66% yet the text in
    the middle of the footer is bigger not smaller. What am I missing?

    (I realise that font percentages less than 80% are bad for accessibility -
    don't know why Eric has gone as low as 66%)

    TIA
    David
    David Graham, Nov 5, 2003
    #1
    1. Advertising

  2. David Graham

    Steve Pugh Guest

    "David Graham" <> wrote:

    >tr#footer td {vertical-align: middle; font-size: 66%; border-top: 3px solid
    >#EFE1D1;}
    >tr#footer td#tg {font-size: 85%; text-align: center;}
    >
    >From what I've learnt in this group, such a declaration would make the
    >center text 85% of 66% which should be even smaller than 66% yet the text in
    >the middle of the footer is bigger not smaller. What am I missing?


    No, the second style does not inherit font-size from the first.
    They both inherit the font-size from the parent element and then apply
    the percentage specified to that.

    properties are inherited from elements further up thedocument tree.

    <td id="tg"> inherits font-size from the tr (and the table, and so on
    upwards) and then applies one or the other of the two styles above. As
    the second one is more specific it appies that one.

    If the first style was tr#footer {} then yes the second style would
    lead to the font-size being 85% of 66%.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Nov 5, 2003
    #2
    1. Advertising

  3. David Graham

    David Graham Guest

    "Steve Pugh" <> wrote in message
    news:...
    > "David Graham" <> wrote:
    >
    > >tr#footer td {vertical-align: middle; font-size: 66%; border-top: 3px

    solid
    > >#EFE1D1;}
    > >tr#footer td#tg {font-size: 85%; text-align: center;}
    > >
    > >From what I've learnt in this group, such a declaration would make the
    > >center text 85% of 66% which should be even smaller than 66% yet the text

    in
    > >the middle of the footer is bigger not smaller. What am I missing?

    >
    > No, the second style does not inherit font-size from the first.
    > They both inherit the font-size from the parent element and then apply
    > the percentage specified to that.
    >
    > properties are inherited from elements further up thedocument tree.
    >


    Of course - stupid me. For some reason I was thinking that tr#footer td was
    the parent of tr#footer td#tg - but it is a sibling. I don't know why I
    didn't spot that.
    Thanks Steve for putting me right on this one.

    David
    David Graham, Nov 6, 2003
    #3
    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. =?Utf-8?B?Q2FsdmluIEtE?=

    HttpContext.Current.Session - should i or shouldn't i

    =?Utf-8?B?Q2FsdmluIEtE?=, Jun 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    531
    =?Utf-8?B?Q2FsdmluIEtE?=
    Jun 15, 2005
  2. dave richards
    Replies:
    2
    Views:
    600
    Paul Furman
    Feb 19, 2004
  3. wial
    Replies:
    2
    Views:
    802
  4. mttc
    Replies:
    2
    Views:
    2,368
    Roedy Green
    Jul 3, 2009
  5. Andrew Walrond
    Replies:
    6
    Views:
    94
    Ara.T.Howard
    Jun 29, 2004
Loading...

Share This Page