SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Add new fonts html file

  1. #1
    Non-Member arun9810128800's Avatar
    Join Date
    Apr 2005
    Location
    India
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add new fonts html file

    how to add new font in our html file, client should be see this font style.

  2. #2
    CTO htmlguy's Avatar
    Join Date
    Feb 2005
    Location
    North Carolina
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Simple

    Simple HTML.

    <font face=".....">This is your fancy font</font>this is normal

    Just for a chart of fonts.
    HTMLGuy

  3. #3
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The web-safe fonts are:

    Serifs:
    Times New Roman
    Georgia

    Sans-serifs:
    Arial
    Verdana
    Trebuchet MS
    Tahoma
    Century Gothic
    Lucida Grande

    Script
    Brush Script MT

    Another way to specify fonts in html is by doing it through CSS. Font tags work, but they're a nightmare to maintain. With CSS, you specify the font once for the whole site, thus if your client wants to see a different font used, you only need to change one word.

    Here's a quick example:

    This goes inbetween the <head> tags
    Code:
    <link rel="stylesheet" type="text/css" href="styles.css" media="all" />
    And this goes into a document named styles.css
    Code:
    body {
    font: 11px Georgia, Tahoma;
    }
    As you may notice, I've included two fonts followed by commas. This is to provide an alternative font if the user doesn't have the first one installed. You can list as many as you like.

  4. #4
    Non-Member arun9810128800's Avatar
    Join Date
    Apr 2005
    Location
    India
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry but my mean we can add more font name in our html page and this html page v can run anywhere in any machine with installed these fonts.

    thannks

  5. #5
    SitePoint Member pubsinbgk's Avatar
    Join Date
    Apr 2005
    Location
    Den,Heaven.
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arun9810128800
    sorry but my mean we can add more font name in our html page and this html page v can run anywhere in any machine with installed these fonts.

    thannks
    Hi,

    I think you should be a bit clear in what you are trying to say.

    Pubsinbgk

  6. #6
    Robert Wellock silver trophybronze trophy
    SitePoint Award Recipient xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,243
    Mentioned
    51 Post(s)
    Tagged
    0 Thread(s)
    No, well theoretically you can embed fonts via CSS though it's not really advisable.
    };-) http://www.xhtmlcoder.com/
    Thinking Web: Voices of the Community

    > March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

  7. #7
    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 arun9810128800
    sorry but my mean we can add more font name in our html page and this html page v can run anywhere in any machine with installed these fonts.

    thannks
    Hi,

    Yes, you can add more fonts. I thought I explained it clearly above. Put your preferred font followed by alternative ones. Waste of time in my opinion though. If you want to use a fancy font, then use an image or sIFR.

  8. #8
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember to always put a generic font-family at the end of the list, in case the user doesn't have any of the specified fonts. For example:
    Code:
    font: 100%/1.5 Verdana,Arial,Helvetica,sans-serif;
    Birnam wood is come to Dunsinane

  9. #9
    Non-Member arun9810128800's Avatar
    Join Date
    Apr 2005
    Location
    India
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But This is not work ?

  10. #10
    Non-Member arun9810128800's Avatar
    Join Date
    Apr 2005
    Location
    India
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is not work ?

  11. #11
    SitePoint Member pubsinbgk's Avatar
    Join Date
    Apr 2005
    Location
    Den,Heaven.
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arun9810128800
    This is not work ?
    Hi,

    I think mstwntd had explained it clearly above. Any ways see if this helps.


    This will go in between the HEAD tag.
    <link href="/yourstylesfilename.css" rel="stylesheet" type="text/css">

    For ex. If your styles file name is styles.css then it should be

    <head>
    <link href="/styles.css" rel="stylesheet" type="text/css">
    </head>

    and your styles.css file should have the fonts which you want to use in your html file.

    body {
    font-size: 100%;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    }

    h1 {
    font-size: 18px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    }

    h2 {
    font-size: 14px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    }

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
  •