SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Sizing fonts

  1. #1
    Intoxicated with the madness petertdavis's Avatar
    Join Date
    May 2002
    Location
    New England
    Posts
    7,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Sizing fonts

    Should I use px or pt? What are the advantages or disadvantages?
    Peter T Davis

    I buy forums - PM me if you're selling.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Pixels and points both have problems actually. Points are generally meaningless for screen media and should probably be disregarded except for in a print stylesheet. Pixels would be fine, but when you set text in pixel sizes IE for Windows won't let you resize the text. I recommend using relative measurements like percents or ems, or using absolute keywords like xx-small, medium, etc. so your users can resize the on-screen fonts. If you really want to use pixels, offer a way to switch styles so the user can choose a stylesheet with larger fonts if they need it.

  3. #3
    SitePoint Zealot ComputerBob's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the past 5 years, I used nothing but pixels, but during my recent site redesign, I switched to using ems, with body text set to 76%, as described by Owen Briggs

    Owen's method gives my site a very cross-browser/cross-platform solution that combines the font-sizing control of fixed sizes with the IE resizability of relative sizes.
    ComputerBob - Making Geek-Speak Chic™
    http://www.computerbob.com
    - XHTML 1.0 Strict + CSS Layout
    Ratings | Forums | Software | Polls | Weird | Quotes | Weather
    Guest Articles | Free Greeting Cards | CB Awards | Search

  4. #4
    SitePoint Evangelist Backlinker1's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    462
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would agree with Vgarcia. The ability to resize fonts is crucial to a suprisingly large number of people. ( including me... Viva mozilla )
    Graham
    Regards. Graham
    Buy, Sell, Talk And Learn About Antique British Ceramics.
    Abcir.org -
    Ceramtique.com - AbcirGroupForums.co.uk

  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I use a relative size for the base font declaration, usually in the body... i.e. 1em or even declarative sizes such as Small, Medium or Large. Then for different sizes such as headers and paragraph text, I use percentages. Say 140% for a page header and 100% for paragraph text. For small text I might use 75% of the original.

    This means everyone can scale their fonts within their browser and elements scale appropriately as if you are zooming in on the document. I have seen some documents where things don't scale like this even though they use relative sizes and the page looks weird if you zoom in on it too much.
    Wayne Luke
    ------------


  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by W. Luke
    I use a relative size for the base font declaration, usually in the body... i.e. 1em or even declarative sizes such as Small, Medium or Large. Then for different sizes such as headers and paragraph text, I use percentages. Say 140% for a page header and 100% for paragraph text. For small text I might use 75% of the original.
    I go the opposite way (percentage for body, ems for everything else)

  7. #7
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any browser issues when using ems or percentage? Do some recognise one but not the other?
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Shouldn't be any in modern browsers. This is all very basic and CSS1 stuff.
    Wayne Luke
    ------------


  9. #9
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks - the references I have are for older versions.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  10. #10
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by W. Luke
    Shouldn't be any in modern browsers. This is all very basic and CSS1 stuff.
    Linux browsers seem to make percentage or em-based text smaller than their Windows counterparts for some reason. That's about the only issue I've ever seen.


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
  •