views:

115

answers:

2

I'm creating an HTML/CSS site and I have the font size adjusted the way I want it when I look at the site on Firefox in Windows (which is what I'm developing on). But when I look at the site in OS X (either Safari or FF), the font size is too big. Not massively bigger, but bigger than my client wants. But if I reduce the font any more, it's going to be too small for Windows machines.

I'm specifying all font sizes in ems in my CSS doc.

I realize that different browsers and platforms render things differently, and there's no way to control exactly how the page will look. But this seems like a pretty big issue and I'm wondering if there is some simple solution that I should know about. And if not, what is the complicated solution?

Thanks in advance.

A: 

Use pixel values instead of ems.

Azeem.Butt
I don't do a lot of web development, but I was under the impression that using ems was the preferred method of specifying a size, especially of a font.
Thomas Owens
Why use pixels? I've read that ems are recommended (though not the only way to go I'm sure). Can you please elaborate?
johnnyb10
Pixel size will be the least reliable, in my experience. Remember that the standard resolutions on Macs tend to be high for their screen sizes. This may have the opposite effect of making the Mac fonts too small, and leave johnnyb10 in essentially the same boat.
John Rudy
Advice such as you've encountered is almost always given on horribly designed blogs by children who also don't do a lot of web development, know very little (if anything) about typography and have never touched a Mac in their lives. Ems, ens, points and percentages are all relative and all dependent on the ability of whomever authored the font you're using to get all their numbers right. Objective dimensions are the only absolute, and pixels are generally the easies to work with seeing as how that's how everything else on the page is going to be drawn.http://www.w3schools.com/css/css_units.a
Azeem.Butt
Sorry, but using w3schools as a reference is not the way to gain credibility. There's a reason to use relative dimensions: because people have different displays, sight capabilties, etc. Hardcoding pixel values eliminates any flexibility on the part of your design.
phoebus
Funny, I seem to be writing this on a Mac right now. And I've been a typography geek since my teenage years, before there was a World Wide Web. And pixels have jacked up many sites I've seen and worked on -- when viewed on my Macs.
John Rudy
However, I will absolutely grant that they are the easiest to work with, primarily because they are an objective dimension and require the least effort to comprehend. But again, as phoebus mentions, you lose a **lot** of flexibility.
John Rudy
So, to any practicing Web developers out there, is this an issue that you have run into (font looks good on Windows but too big on Mac), and if so, what do you do to address it?
johnnyb10
NSD: I flagged that comment as offensive. Not that I need to explain myself to you, but I used iWeb because I was lazy. Yes, **lazy.** I'd been running Community Server there, and killed my blog because I wasn't updating it. Then I decided to throw SOMETHING up there, mostly temporary junk. I'm also flagging the entire post here for mod attention.
John Rudy
@NSD: The W3C knows more than you do, and they say "Use relative rather than absolute units in markup language attribute values and style sheet property values." (Source: Web Content Accessibility Guidelines 1.0, checkpoint 3.4) http://www.w3.org/TR/WCAG10/
R. Bemrose
A: 

This may be very very out of date, but a few years back I used % values that work for most browsers:

px  %
9    56%
10  61%
11  68%
12  74%
13  81%
14  87%
15  94%
16  100%
17  105%
18  111%
19  119%
20  125%
21  131%
22  137%
23  144%
24  150%
25  156%
26  162%
27  168%
28  174%
29  180%
30  186%
31  192%
32  198%
33  204%
34  210%
35  216%
36  222%

So if I wanted 12px sized text I'd use 74%:

.myStyle{
    font-size:74%;
}

At the time, I had actually tested all the % values to see which values worked best across a range of browsers.

Rew