SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast Ricky's Avatar
    Join Date
    Jan 2004
    Location
    Unknown
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post How do I change font style ?

    I'd like to know,


    How can I change the font style (Arial, Times New Roman, Courier New, etc) in an HTML document? What are the tags to use and where to use them, if needed?

    Also, what is the default font style of an HTML document (the one I am using since the beginning)?


    Thanks



    Ricky

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    If you want to code it right in the (X)HTML file use this:
    Code:
    <font face="Arial, Helvetica, Verdana, Sans Serif" size="2" color="#333333">
    If you want to use CSS than place this in the head section between the <head></head> tags:
    Code:
      <style type="text/css">
      body{ font-family: Arial, Helvetica, Verdana, "Sans Serif";}
      </style>
    I believe default font is whatever font the user has set as their default.

    Hope this helps

    Later
    Johnny

  3. #3
    SitePoint Enthusiast Star3night's Avatar
    Join Date
    Feb 2004
    Location
    Milky, WY
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Valid Code

    For your page to validate, use inline styles:

    Code:
    <p style="font-family: arial;">
    Change the font of a whole paragraph
    </p>
    
    <p>
    In a paragraph, just change this <span style="font-family: arial;">word</span>, none of the others.
    </p>
    The <font> tag is depricated. This means, while it works for now, browsers could stop supporting it in thier future builds.

    And while I'm being zenistic, it's easiest for maintenance if you keep your styles in an external style sheet.

  4. #4
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Star3night
    For your page to validate, use inline styles:
    Pages using external style sheets will also validate, of course, and are the the best way to go. I would only use inline rules occasionally to tweak something here and there. Keeps the markup clean.

    Code:
    <p style="font-family: arial;">
    Might be better to list a font family like: Arial, Helvetica, Sans-Serif in case Arial isn't installed.

    And while I'm being zenistic, it's easiest for maintenance if you keep your styles in an external style sheet.
    Amen.

  5. #5
    SitePoint Enthusiast Ricky's Avatar
    Join Date
    Jan 2004
    Location
    Unknown
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help, some of the codes you gave me actually works;

    But what is a style sheet ? and what is CSS ?


    Note: I use notepad as my editor...

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Ricky
    Thanks for the help, some of the codes you gave me actually works;

    But what is a style sheet ? and what is CSS ?


    Note: I use notepad as my editor...
    http://www.w3schools.com/css/ has the answer to your questions .

  7. #7
    Starting to-digg-in ********* jamesxv7's Avatar
    Join Date
    Oct 2003
    Location
    Island of Puerto Rico @ the Caribbean
    Posts
    873
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.w3.org/Style/CSS/ <-- Geeks

    Here is a great thread (like all in SPF) that you will need later when you learn more about CSS, enjoy learning CSS
    http://www.sitepoint.com/forums/showthread.php?t=121128
    James: Ecodig - My Blog - My Gallery
    Validate your sites: CSS - HTML/XHTML
    Without faith you are lost.

  8. #8
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a new, very user-friendly explanation:

    http://www.wpdfd.com/editorial/basics/index.html
    ::: certified wild guess :::

  9. #9
    Starting to-digg-in ********* jamesxv7's Avatar
    Join Date
    Oct 2003
    Location
    Island of Puerto Rico @ the Caribbean
    Posts
    873
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by adios
    Here's a new, very user-friendly explanation:

    http://www.wpdfd.com/editorial/basics/index.html
    Great tutorial
    James: Ecodig - My Blog - My Gallery
    Validate your sites: CSS - HTML/XHTML
    Without faith you are lost.

  10. #10
    SitePoint Enthusiast Ricky's Avatar
    Join Date
    Jan 2004
    Location
    Unknown
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the advices and the links

    I'm gonna use them...

  11. #11
    SitePoint Member bstraub's Avatar
    Join Date
    Feb 2004
    Location
    Huntingtown, MD
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Enjoy, I just started learning CSS a few days ago...boy it sure does rock. Now I just need to learn how to do page layouts with it.


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
  •