2
.bold{
font: 900 20px helvetica;
}

.bolder{
font: 700 20px helvetica;
}

I am getting same result for two class except Mozilla Firefox.

Can anyone tell me how can I get same result in all browser (Firefox,Chrome,IE,safari,opera)

Arif
  • 978
  • 12
  • 29

2 Answers2

6

It depends on the font. The weight has to be available within the font displayed, or the browser will pick the closest available weight.

Helvetica must not have all of those weights embedded within the font file.

Read about it more here: https://developer.mozilla.org/en/CSS/font-weight

It says:

100, 200, 300, 400, 500, 600, 700, 800, 900

Numeric font weights for fonts that provide more than just normal and bold. If the exact weight given is unavailable, then 600-900 use the closest available darker weight (or, if there is none, the closest available lighter weight), and 100-500 use the closest available lighter weight (or, if there is none, the closest available darker weight). This means that for fonts that provide only normal and bold, 100-500 are normal, and 600-900 are bold.

Perhaps the different browsers have different rules about how to treat font weights when the weight is unavailable.

Cᴏʀʏ
  • 105,112
  • 20
  • 162
  • 194
  • Uh, Arial is not "Helvetica on Windows". – Jared Farrish Jan 15 '12 at 19:48
  • @JaredFarrish: While they are painfully similar looking, it is true they are not the same font. Unless you buy the font from Linotype there is no default font called "Helvetica" on Windows -- though many people specify Arial as a Helvetica alternative in their stylesheets. I edited my post. – Cᴏʀʏ Jan 16 '12 at 01:26
  • 2
    Microsoft designated Arial years ago as an alternative to Helvetica because they were too cheap to license Helvetica, so it was intended to mimic Helvetica in a sense, but they are not the same font. Not to mention Arial is ugly, which is why Calibri was commissioned to replace it, while Helvetica is considered one of the most beautiful fonts available. It's just one of those things; what you meant was "if Helvetica is not available, another font like Arial might be substituted by the browser according to preferences". But they're two completely distinct, different fonts. – Jared Farrish Jan 16 '12 at 12:05
0

Most computers do not have a font named “helvetica”, so browsers will fall back to their default font. This may well be different in different browsers. Most fonts on people’s computers have just normal and bold font weight, so the mildly surprising thing is that some browsers implement weight 900 as different from 700 in some situations.

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390