SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Addict clearweb's Avatar
    Join Date
    Dec 2001
    Location
    Southern California
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question CSS Font question

    I am somewhat new with CSS. I want to have an Arial font and MS Sans Serif as the secondary font to be available. The problem is that my fonts come up as MS Sans Serif. Is it because I have quotes (') around the MS Sans Serif? This is an example of my question:


    FONT-SIZE: small;
    COLOR: #000000;
    FONT-FAMILY: Arial, 'MS Sans Serif'


    Any help is appreciated!! Thanks

  2. #2
    SitePoint Zealot nspencer's Avatar
    Join Date
    Nov 2001
    Location
    Purdue
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I'm right, I believe you need to use double quotes (")
    Code:
    FONT-FAMILY: Arial, "MS Sans Serif"
    Nate Spencer
    [w] nspencer.com
    [e] nate@nspencer.com

  3. #3
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why are you quoting it at all? Quotes dont belong in CSS.
    THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
    THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
    OVER YOUR DOG. <-- MediaWiki installation guide

  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    according to this website, font names that are more than one word in length should be double-quoted...
    "There's no justice like angry mob justice!" --Seymour Skinner

  5. #5
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the styles in-line or in the head/external stylesheet?

    If in the head/external stylesheet:

    td,p,li
    {
    color:#000000;
    font-family: arial, "MS sans serif";
    font-size:small;
    }

    if inline:

    <td style="color:#000000;font-family:arial,'MS san serif';font-size:small;">

    HTH

  6. #6
    SitePoint Addict clearweb's Avatar
    Join Date
    Dec 2001
    Location
    Southern California
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I wanted the Arial to be the dominant font (or to be first in line), then is that coding correct?

    On my pages, the font is not Arial...it is coming up as Sans Serif.

  7. #7
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes to have arial be the first choice, thats the way to do it. Try using verdana instead of arial as a test. Could be the problem lies elsewhere.

    If your still struggling, post the code. Someone here will help get it figured out.

  8. #8
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    try removing the spaces also
    font-family:arial,etc...
    I can't remember where it was but I read that spaces aren't liked by some. Also if your machine doesn't have arial then it will skip and use sans-serif although seem scrazy that you don't have it - I agree try verdana and see if that helps.

    good luck
    Sarah
    Regular user

  9. #9
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I know and from experience I would say this is how it has to go:

    p, td, li {font-family: arial, ms sans serif;
    color: #000000;
    font-size: small;
    }

    I've always been doing that and I never encountered any problems.
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net

  10. #10
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And white spaces have nothing to do with it
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net

  11. #11
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Phil.Roberts
    Why are you quoting it at all? Quotes dont belong in CSS.
    According to the W3C, they apparently do.

  12. #12
    SitePoint Zealot nspencer's Avatar
    Join Date
    Nov 2001
    Location
    Purdue
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought they had to be there for fonts with whitespace. Looks like I was right for once.
    Nate Spencer
    [w] nspencer.com
    [e] nate@nspencer.com

  13. #13
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damn I might have to review my CSS...
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net


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
  •