Change the default font of my website

Discussion in 'CSS' started by kjk11, Jul 13, 2012.

  1. #1
    I was seeing if anyone could tell me what code to use to change the default font for my template on my website, I don't know much about css
     
    Solved! View solution.
    kjk11, Jul 13, 2012 IP
  2. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #2
    put this in your .css

    
    body {
        font-family: NAME-OF-FONT;
    }
    
    Code (markup):
     
    GMF, Jul 13, 2012 IP
  3. kjk11

    kjk11 Member

    Messages:
    358
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    can you add the font size 10pt in that to
     
    kjk11, Jul 13, 2012 IP
  4. #4
    But of course!

    
    body {
        font-family: NAME-OF-FONT;
        font-size: SIZE-OF-FONT;
    }
    
    
    Code (markup):
    Now, before you ask any more questions, it would be better if you would learn some basic css. There are many tutorial sites around the web, like:

    
    http://html.net/
    http://www.w3schools.com
    http://www.tizag.com/
    
    Code (markup):
     
    GMF, Jul 13, 2012 IP
  5. kjk11

    kjk11 Member

    Messages:
    358
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    I thought I had it solved I am just trying to change the font size and this is what I put in but nothing happened
    body {
    margin:0;
    padding:0;
    font-size:14px !important;
    font-family:Arial, Verdana, Helvetica, Sans-serif;
    text-align:center;
    background:#000
    }
     
    kjk11, Jul 13, 2012 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Well, do you have a link to the site in question?

    NOT that it's a good idea to set px sized fonts across the entire page (since that's the opposite of accessibility), or to declare a font-size without forcing a new line-height (since default line-height cannot be trusted)... and really you might want to look into condensed declarations at that point to save a few bytes... and a reset so you aren't saying margin:0; padding:0; on every last element just to get it behaving cross-browser.

    Without seeing the site it's hard to say what could be overriding your declarations... though 14px on body only effects body, even with !important that does absolutely nothing if I were to go font-size:150% in a h2. That H2 would just be 21px (150% of body or it's parent).

    doing
    * { font-size:100% !important }

    before you decalare body in the CSS may fix it, but that's a stupid way of going about it -- really you should go through and change ALL the font declarations in the stylesheet. If the stylesheet is too big for that using search or declares it too many times, there's something horrifically wrong with the stylesheet.

    Though again, without seeing the site in question anything we tell you is a wild guess.

    -- edit -- though if it's that campersridge site (did a search for threads started by you), the markup is horrifically out of date and the entire page is filled with accessibility faux-pas. The lack of a doctype, the elements in HEAD like P that cannot go in HEAD, nonsensical/non-existant heading orders, endless pointless wrapping div for no good reason, presentational markup, static style inlined in the markup, tables for layout, tags like FONT and attributes like ALIGN that have zero business being used in websites written after 2001, etc, etc... pretty much means that like a lot of other websites, it probably needs to be thrown away and started over -- there's little worth trying to save from it.
     
    Last edited: Jul 14, 2012
    deathshadow, Jul 14, 2012 IP
  7. kjk11

    kjk11 Member

    Messages:
    358
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #7
    I just want to know how to change the font size, I don't know alot about css coding, but this website was designed by professionals and that millions of dollars a year so i think they know what there doing
     
    kjk11, Jul 15, 2012 IP
  8. netcommlabs

    netcommlabs Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Change in your main css file body{ font-family:Arial; }
     
    netcommlabs, Jul 18, 2012 IP
  9. biggerlol

    biggerlol Peon

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    put this in style.css
     
    biggerlol, Jul 19, 2012 IP