SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: CSS on Macs

  1. #1
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS on Macs

    I use pixels to determine font size and I read somewhere that Macs will display smaller text than PCs. So how do I size my text to make it cross-platform? If there's no way to do this, how can I specify a separate stylesheet for Macs and another for PCs?

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Generally people ask this question a lot and basically the Apple Macintosh displays fonts slightly smaller, thus using two alterative style sheets and a browser sniff would help alleviate the problem, I donít use Macs but I know that to be the common practice.

    Most people use JavaScript Sniffers similar to the code bellow, I cannot guarantee the JavaScript is correct, better you use PHP:

    <script language="javascript">
    <!-- //
    if (navigator.appVersion.indexOf("Mac") != -1) {
    document.write('\<link rel=\"stylesheet" href=\"/styles/mac.css\"\>');
    }
    else {
    document.write('\<link rel=\"stylesheet\" href=\"/styles/win.css\"\>');
    }
    // -->
    </script>

    Some people don't like JavaScript, etc.

    };-) http://www.xhtmcoder.com/

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just as an FYI...

    The reason Macs display text smaller is because their default resolution is 96dpi instead of 72dpi. More dots means slightly smaller display. It's usually only off by a point or two.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys!

    I'll look into the Javacript sniffer scripts. I've seen these befotre but never as a way to swap stylesheets.

    I know about the default resolution but I'm not sure if my text will be too small. I'm using 11 px. So what might this be equivalent to in a Mac? (sorry, I'm terrible at math)

  5. #5
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  6. #6
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Bill, that pretty much answered my question


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
  •