#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    What is css code for <font size=1> ?


    I have been teaching myself css code today to convert over parts of my webpage.

    To define a slightly smaller font, I use the HTML code: <font size=1>

    What would be the css code equivalent for this?

    Thanks.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    It depends where you want the smaller font and by how much, but if you want your paragraph font size to be smaller than the main page font size (this is just an example) then you would apply it to the p tag in your css. It also depends if you want to set a specific pixel size or use ems to base it on the parent font size.

    For example:
    Code:
    body {
      font-size: 16px; // This is actually the default size for browser fonts anyway
    }
    p {
      font-size: 14px; // Or, if using ems, 0.875em
    }
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,122
    Rep Power
    4258
    Welcome to DevShed Forums, helpneeded22.

    It's best to avoid setting font-size in "px", pixels. (And "pt", points, may be fine for print stylesheets but shouldn't be used for other media.)

    I recommend that you try using "font-size: xx-small" or "font-size: smaller".

    More information: http://style.cleverchimp.com/font_si...ervals.html#cc
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by Kravvitz
    Welcome to DevShed Forums, helpneeded22.

    It's best to avoid setting font-size in "px", pixels. (And "pt", points, may be fine for print stylesheets but shouldn't be used for other media.)

    I recommend that you try using "font-size: xx-small" or "font-size: smaller".
    Thanks, that is just what I was looking for. I really wanted to avoid going with a "set" size, and use something a little more relative, and I believe this it.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    18
    Rep Power
    0
    style="font-size:10px; it is the equal of your question. Please have a look. and let me know.

IMN logo majestic logo threadwatch logo seochat tools logo