SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru Dashman's Avatar
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Specify two font sizes ?

    Hi all,
    I have often come across style sheets on other sites, and even tutorials, where the designer specifies two font sizes in one class declaration like so:
    HTML Code:
         .example
      {
       	 font: Tahoma,Arial, Helvetica, sans-serif;
       	 size: 11px/14px;
     }
    Could anyone please tell me why this is done ?

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    The second one is line-height

    font-size/line-height
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Guru Dashman's Avatar
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah, I see, thank you

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using pixel values is a bad thing in both cases, though. It makes the text unresizable in IE/Win, which means the text will be too small to read for some users (and possibly too large for others, depending on the actual value).
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Guru Dashman's Avatar
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so, should percentages be used ?

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, either percents or ems (whichever you choose is only a matter of taste).

    For line-height the most useful value is frequently unitless. For instance:
    Code:
    .example {
      font:120%/1.5 Tahoma,Arial, Helvetica, sans-serif;
    }
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Guru Dashman's Avatar
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    get ya . . . . . thanks for that


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
  •