SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    eez
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it necessary to include the "sans-serif" words in "font:" definitions?

    Hi!

    These two font definitions loon the same in Opera, FF and IE6 on Windows:

    font: 13px Verdana, sans-serif;

    and

    font: 13px Verdana;

    My questions are:

    1/ Is it necessary to include the "sans-serif" words at the end of the definition?

    2/ Sometimes in other web designers work (), I see this same font definition with many other unused fonts after the verdana font, like:

    font: 13px Verdana, Helvetica, Arial,..., sans-serif;

    Is this necessary? I doubt it is because the result is the same when removing them, and everybody has Verdana on his/her computer, right?

    Thanks for your precious time!

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not technically necessary, but you should always do it.

    If you specify
    Code:
    font: 100% Verdana;
    you never know what it will look like for those who don't have Verdana installed (e.g., many Linux users).

    By specifying multiple font names, you're providing a list for the browser to use. If the first font isn't installed, try the second, etc. By including a generic font family (such as sans-serif) at the end, you at least ensure that some sanserif font will be used.

    Also, never specify font sizes in pixels, since that will prevent IE users from resizing the text. Use percents or em.
    Birnam wood is come to Dunsinane


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
  •