SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    I am obstructing justice. bronze trophy fatnewt's Avatar
    Join Date
    Jul 2002
    Location
    Ottawa, Canada
    Posts
    1,766
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE5 font sizes: divs and tables

    Here's my situation:

    I'm using a CSS-based layout that uses a combination of positioned <div> elements and minimal tables for the layout. - there is important text both within and outside the table.

    I'm using the em as my unit for fonts. I've specified the size for the body element.

    The layout looks fine in IE6, Firebird, Opera... but in IE5 the text in the table is a bit larger than the text outside of the table.

    Is there away around this? I'm playing with my CSS but I can't get my logic straight (I should really be drinking coffee.) Has anyone else had this problem?
    Colin Temple [twitter: @cailean]
    Web Analyst at Napkyn


  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,549
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    In IE6 in quirks mode ( so I assume IE5 as well) the table does not inherit the font size from the body (I think some other browsers may also be the same in quirks mode).

    You need to set the size for the table as well making sure that the size doesn't compound by setting the table to 1 em (ie the default size as defined in the body).
    Code:
    body{
    font-size: .8em;
    }
    table {font-size:1em}
    The table size of 1 em should be 100% of the size set in the body (I think that's how it works).

    As I don't use tables I don't have this problem (smug) so check if I've got it right .

    Paul

  3. #3
    I am obstructing justice. bronze trophy fatnewt's Avatar
    Join Date
    Jul 2002
    Location
    Ottawa, Canada
    Posts
    1,766
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    Code:
    table {font-size:1em}

    I knew it something simple like that was going to work. I just managed to try all the wrong things. I really need to start drinking coffee.

    Quote Originally Posted by Paul O'B
    As I don't use tables I don't have this problem (smug) so check if I've got it right .
    Yeah, I wouldn't be using them either, but it isn't completely up to me.
    Colin Temple [twitter: @cailean]
    Web Analyst at Napkyn



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •