SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Apr 2003
    Location
    East Coast USA
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Font Size in Pixels?

    Hi All...

    I need help. I just read how you can specify a size in your
    font tag by using numbers like 1, 2, 3, etc. Is there a way
    to specify it in pixels instead?

    Thanks,
    Carolyn

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Welcome to the 21st century!

    Don't use font tags.

    Try this: http://www.w3schools.com/css/tryit.a...ycss_font-size

    And to lean more details, try browsing around this site: http://css-discuss.incutio.com/?page=FontSize

    Enjoy the new world

    Douglas
    Hello World

  3. #3
    SitePoint Addict
    Join Date
    Apr 2003
    Location
    East Coast USA
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    Welcome to the 21st century!

    Don't use font tags.

    Try this: http://www.w3schools.com/css/tryit.a...ycss_font-size

    And to lean more details, try browsing around this site: http://css-discuss.incutio.com/?page=FontSize

    Enjoy the new world

    Douglas

    Hi Douglas.

    Thanks. I already use css on the majority of my site. It's a really long story and I don't feel like typing a novel, so is there a way to use pixels in the font tag?

    Thanks,
    Carolyn

  4. #4
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure... with CSS:

    Code:
    <font style="font-size: 100px;">Text</font>
    Douglas
    Hello World

  5. #5
    SitePoint Addict
    Join Date
    Apr 2003
    Location
    East Coast USA
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    Sure... with CSS:

    Code:
    <font style="font-size: 100px;">Text</font>
    Douglas

    Where do you place that code? Anywhere in the head of the page?

    Why did you enter 100px....would I just replace that with my desired size...12px?

    So are you saying the ONLY possible way to do this is with CSS, correct?

    Thanks,
    Carolyn

  6. #6
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by coolcarolyn
    Where do you place that code? Anywhere in the head of the page?
    That is just a bog standard font tag. Use it anywhere you would use any other font tag. (Wrap it around the text you want to set the size of in the <body> section.)


    Quote Originally Posted by coolcarolyn
    Why did you enter 100px....would I just replace that with my desired size...12px?
    That's so you can put it in a page, and easily see that it is working. You can put in 12px. You could also put in any other CSS font size, for example 0.8em, 80%, 12pt etc etc.

    Quote Originally Posted by coolcarolyn
    So are you saying the ONLY possible way to do this is with CSS, correct?
    Here is the W3C spec for font:
    http://www.w3.org/TR/html401/present...html#edef-FONT

    size
    • An integer between 1 and 7. This sets the font to some fixed size, whose rendering depends on the user agent. Not all user agents may render all seven sizes.
    • A relative increase in font size. The value "+1" means one size larger. The value "-3" means three sizes smaller. All sizes belong to the scale of 1 to 7.
    There may be browsers whch accept size="12px" though as I say, I don't use font tags anymore so I'm not sure what support there is for this. I would assume that CSS is the only way to set font-sizes in pixels.

    Regards,
    Douglas
    Hello World


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
  •