Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Explanation for css font:

    Today, I saw some code that was a bit different than I am used to seeing. Hope someone can explain the /1?

    The code was:
    font: 80%/1 arial, helvetica, sans-serif;

    I understand the font types, but what has me stumped is why the /1? Why not just set it to 80%?

    Just thought someone might have an idea.

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    The /1 designates the line-height (leading). Leading is typically something around 1.5 by default.

    For example, font: 0.75em/1.6 serif; would give me a line-height of 1.6.

  • #3
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    And does that shorthand work across all browsers? First time I've seen that too.
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,699
    Thanks
    0
    Thanked 233 Times in 228 Posts
    Hi there cc4digital,

    the full font shorthand is...
    font: [font-style] [font-variant] [font-weight] [font-size/line-height ] [font-family ]

    Further reading:-

    coothead
    Last edited by coothead; 06-05-2010 at 05:23 PM.

  • #5
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Font shorthand works in any browser that vaguely matters.


  •  

    Posting Permissions

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