Font inheritance <font/> tag vs CSS

Atom RSS

This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.

Main navigation:

Search reports by browser:

When there is unsupported font name in the font-face attribute of a font tag Mozilla based browsers don't revert back to the surrounding elements CSS defined font-family.

Test page Workaround is not included
Reported by: Jaap Roes.

(Orphaned), Mozilla | Reported on 22 March 2005.


(Add your own)

Posted by Vesa Piittinen on 22 March 2005


Just to confirm it: this happens with all DOCTYPEs, not just HTML4 Transitional. I would have expected this behaviour with HTML4 and XHTML 1.0 Transitional, but it appeared with XHTML 1.0 Strict and XHTML 1.1 as well. In the other hand, the DOCTYPEs above don't support so it can't be considered as bad of a bug. Wasn't it in the old days that you had to define everything element by element basis and there was no such thing as inherited properties?

Posted by Vesa Piittinen on 22 March 2005


There should read ...DOCTYPEs above don't support <font> tag so...

Posted by Philip Hazelden on 24 March 2005


I'd have considered it a worse bug in a doctype which doesn't support the tag than in one which does. In XHTML strict the tag should be ignored, whereas if it's legitimate you might expect an unknown font face to become the default.

Posted by CornedBee on 28 March 2005


What makes this a "bug", though? As far as the HTML 4.01 spec goes, there is no defined behaviour if none of the specified fonts are found. Mozilla's behaviour is just one of many possible.
In fact, Mozilla's behaviour is compliant with the CSS1 spec if you assume that the font face attribute is directly converted to a font-family attribute:
"If there is no font within the family selected in 2, then use a UA-dependent default 'font-family' and repeat step 2, using the best match that can be obtained within the default font."
It does not say that the above font should be inherited, instead it says that a browser default font should be used.

Post a comment

Commenting guidelines:

  1. When quoting specs, articles or your own research, please include a URL of the document.
  2. Test your stuff. When reporting browser behaviour, make sure that your report is correct.