Re: Preferred way to size fonts

Discussion in 'HTML' started by richard, Nov 6, 2008.

  1. richard

    richard Guest

    On Wed, 05 Nov 2008 16:37:46 -0600, Cliff <HiJack-at-fidnet-dot-com>
    wrote:

    >
    >I've tried to follow this group for awhile now. I've noticed that
    >some of you have very preferred ways and reasons to size fonts on web
    >sites. HTML or CSS.
    >
    >It seems you don't like specific settings, but rather settings that
    >can vary with browser display size. I think you all have good
    >reasoning, but I can't remember which is best.
    >
    >Right now, on most of my font settings, I use "Font=2, or 3 or 4."
    >etc. in the cases where I need to set my font size. I've going to be
    >going over most of my html files soon and that would be a good time to
    >change those settings to the better version.
    >
    >What are your versions of the best way.
    >
    >Cliff


    Personally I would not use font-size for the body. That should be left
    up to the user's browser settings.
    The body size will be 100% naturally.

    Use an em for resizing specific items.
    That way it does not matter what the user has as a default.

    <font> should not be used.
    instead, use the css {font:1em;} method.
    richard, Nov 6, 2008
    #1
    1. Advertising

  2. richard

    Nik Coughlin Guest

    "richard" <> wrote in message
    news:...
    > <font> should not be used.
    > instead, use the css {font:1em;} method.


    Hi richard,

    You can't use the font shorthand by itself to set size. You need to do:

    selector {
    font-size: 1em;
    }

    You can remove many of the properties from the font shorthand and still have
    it work, but you can't have just font-size.

    When you use the shorthand you need to list the properties in the following
    order:

    1. font-style
    2. font-variant
    3. font-weight
    4. font-size
    5. font-family

    You can omit properties from the start of the list but you cannot list them
    in a different order to above or omit font-size or font-family.

    All of the following will work:

    selector {
    font: italic small-caps bold 2.5em sans-serif;
    }
    selector {
    font: small-caps bold 2.5em sans-serif;
    }
    selector {
    font: bold 2.5em sans-serif;
    }
    selector {
    font: 2.5em sans-serif;
    }

    These won't:

    selector {
    font: sans-serif;
    }
    selector {
    font: 2.5em;
    }
    selector {
    font: small-caps 2.5em;
    }

    As Jukka is wont to say, don't use shorthand properties unless you really
    understand what you're doing... and according to Jukka, if you do
    understand, you won't use them, though I have to respectfully disagree with
    that.
    Nik Coughlin, Nov 6, 2008
    #2
    1. Advertising

  3. richard

    richard Guest

    On Fri, 7 Nov 2008 09:37:29 +1300, "Nik Coughlin" <>
    wrote:

    >"richard" <> wrote in message
    >news:...
    >> <font> should not be used.
    >> instead, use the css {font:1em;} method.

    >
    >Hi richard,
    >
    >You can't use the font shorthand by itself to set size. You need to do:
    >
    >selector {
    > font-size: 1em;
    >}
    >
    >You can remove many of the properties from the font shorthand and still have
    >it work, but you can't have just font-size.
    >
    >When you use the shorthand you need to list the properties in the following
    >order:
    >
    >1. font-style
    >2. font-variant
    >3. font-weight
    >4. font-size
    >5. font-family
    >
    >You can omit properties from the start of the list but you cannot list them
    >in a different order to above or omit font-size or font-family.
    >
    >All of the following will work:
    >
    >selector {
    > font: italic small-caps bold 2.5em sans-serif;
    >}
    >selector {
    > font: small-caps bold 2.5em sans-serif;
    >}
    >selector {
    > font: bold 2.5em sans-serif;
    >}
    >selector {
    > font: 2.5em sans-serif;
    >}
    >
    >These won't:
    >
    >selector {
    > font: sans-serif;
    >}
    >selector {
    > font: 2.5em;
    >}
    >selector {
    > font: small-caps 2.5em;
    >}
    >
    >As Jukka is wont to say, don't use shorthand properties unless you really
    >understand what you're doing... and according to Jukka, if you do
    >understand, you won't use them, though I have to respectfully disagree with
    >that.



    I was trying to point out to the OP how to apply the font through css.
    Since he's going to learn, he'll soon find out what not to do.
    richard, Nov 8, 2008
    #3
  4. Gazing into my crystal ball I observed richard <>
    writing in news::

    > On Fri, 7 Nov 2008 09:37:29 +1300, "Nik Coughlin" <>
    > wrote:
    >
    >>"richard" <> wrote in message
    >>news:...
    >>> <font> should not be used.
    >>> instead, use the css {font:1em;} method.

    >>
    >>Hi richard,
    >>
    >>You can't use the font shorthand by itself to set size. You need to
    >>do:
    >>
    >>selector {
    >> font-size: 1em;
    >>}
    >>

    >
    > I was trying to point out to the OP how to apply the font through css.
    > Since he's going to learn, he'll soon find out what not to do.


    So why should the OP have to learn the hard way, and come back here
    confused. If you are going to give advice, make sure it is correct
    before you do so.

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Nov 8, 2008
    #4
  5. richard

    Chaddy2222 Guest

    On Nov 8, 1:10 pm, Adrienne Boswell <> wrote:
    > Gazing into my crystal ball I observed richard <>
    > writing innews::
    >
    >
    >
    >
    >
    > > On Fri, 7 Nov 2008 09:37:29 +1300, "Nik Coughlin" <>
    > > wrote:

    >
    > >>"richard" <> wrote in message
    > >>news:...
    > >>> <font> should not be used.
    > >>> instead, use the css {font:1em;} method.

    >
    > >>Hi richard,

    >
    > >>You can't use the font shorthand by itself to set size.  You need to
    > >>do:

    >
    > >>selector {
    > >>  font-size: 1em;
    > >>}

    >
    > > I was trying to point out to the OP how to apply the font through css.
    > > Since he's going to learn, he'll soon find out what not to do.

    >
    > So why should the OP have to learn the hard way, and come back here
    > confused.  If you are going to give advice, make sure it is correct
    > before you do so.
    >

    I agree 100% with this. A lot of bad advice already is around on the
    net, especially about HTML and web design. We do not need to
    contribute to that here.
    --
    Regards Chad. http://freewebdesignonline.net
    Chaddy2222, Nov 8, 2008
    #5
  6. richard

    Nik Coughlin Guest

    "richard" <> wrote in message
    news:...
    > On Fri, 7 Nov 2008 09:37:29 +1300, "Nik Coughlin" <>
    > wrote:
    >
    >>"richard" <> wrote in message
    >>news:...
    >>> <font> should not be used.
    >>> instead, use the css {font:1em;} method.

    >>
    >>Hi richard,
    >>
    >>You can't use the font shorthand by itself to set size. You need to do:
    >>
    >>selector {
    >> font-size: 1em;
    >>}


    8< snippity snippity

    >
    > I was trying to point out to the OP how to apply the font through css.
    > Since he's going to learn, he'll soon find out what not to do.
    >


    I wasn't telling you off, just trying to steer you in the right direction
    Nik Coughlin, Nov 8, 2008
    #6
  7. richard

    Acmeous

    Joined:
    Oct 31, 2008
    Messages:
    4
    Location:
    Kolkata, India
    I just prefer using px for defining font size like -
    font-size: 1px;
    Just trying to implement the term pixel perfect. But the problem with pixel is that there is huge change in size between 11 and 12 px.
    Acmeous, Nov 10, 2008
    #7
    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. Shiperton Henethe
    Replies:
    117
    Views:
    2,148
    Andy Dingley
    Dec 22, 2004
  2. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,563
    Michael Jung
    May 25, 2008
  3. Chris F.A. Johnson

    Re: Preferred way to size fonts

    Chris F.A. Johnson, Nov 5, 2008, in forum: HTML
    Replies:
    19
    Views:
    755
    Sherm Pendley
    Nov 8, 2008
  4. dorayme

    Re: Preferred way to size fonts

    dorayme, Nov 5, 2008, in forum: HTML
    Replies:
    0
    Views:
    426
    dorayme
    Nov 5, 2008
  5. sam
    Replies:
    0
    Views:
    405
Loading...

Share This Page