SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Font sizing - again.

    Whilst reading about cross-browser reliable font sizing, I'll post here for suggestions to something I've not seen answered.

    If I've understood this correctly...

    Using relative sizing - example p {font-size:150%}, then p elements should be 150% larger than they would have been without the rule.

    So, if I spec {font-size:12px} in html and body, then p {font-size:100%} does that provide text that is by default 12px and can also be resized by IE?

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by gulliver
    So, if I spec {font-size:12px} in html and body, then p {font-size:100%} does that provide text that is by default 12px and can also be resized by IE?
    Is that really hard to check?

  3. #3
    The MacGyver of Design bronze trophy Johan Dahlström's Avatar
    Join Date
    Oct 2004
    Location
    Uppsala, Sweden
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by gulliver
    So, if I spec {font-size:12px} in html and body, then p {font-size:100%} does that provide text that is by default 12px and can also be resized by IE?
    Yeah. The text will be scalable in IE.
    Setting a font-size in body kinda defines a starting-point for the font sizes. Every descending element that does not have a font size set to it by default (such as h1, h2 ... h6, td ) will inherit the font size from it's parent, and from it's grand parents (and so on) if the parent itself does not define one.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by gulliver
    Using relative sizing - example p {font-size:150%}, then p elements should be 150% larger than they would have been without the rule.
    Er ... yes. To be correct, the P element's font size will be 150% of its parent element's font size, so inheritance comes into play here.

    Quote Originally Posted by gulliver
    So, if I spec {font-size:12px} in html and body, then p {font-size:100%} does that provide text that is by default 12px and can also be resized by IE?
    NO!
    If you specify a fixed font base size, the text cannot be resized (in IE). 100% of 12px is 12px, which is still a fixed size.
    Birnam wood is come to Dunsinane

  5. #5
    The MacGyver of Design bronze trophy Johan Dahlström's Avatar
    Join Date
    Oct 2004
    Location
    Uppsala, Sweden
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo
    Er ... yes. To be correct, the P element's font size will be 150% of its parent element's font size, so inheritance comes into play here.


    NO!
    If you specify a fixed font base size, the text cannot be resized (in IE). 100% of 12px is 12px, which is still a fixed size.
    Sorry, my bad. Looked at the wrong elements .

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wasn't shouting at you, Johan. I just wanted to make the 'no' hard to miss.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, gents.
    My simple response to Egor's >Is that really hard to check? is this: As a Mac user, yes. Additionally, as forums are a place to share and help... those who know assist those who don't... the query is valid and hence your response is needlessly unconstructive and does nought to build respect for you.

    Moving on... thanks to Johan and Tommy for providing the answer. It clears the uncertainty.


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
  •