Chazy Chaz
Chazy Chaz

Reputation: 1851

font style not working in firefox

the following font style code does not work in firefox, I tested it in chrome and iexplorer and it works, so must be a compatibility problem.

font: italic normal normal normal 12px/15.3599996566772px Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif;

Can someone confirm it, or maybe there's an alternative for firefox.

FIX:

font: italic normal normal 12px/15.3599996566772px Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif;

Upvotes: 1

Views: 324

Answers (2)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201558

This appears to be a bug in Firefox. In the Developer Tools, no errors are shown, but when inspecting style sheets, the styles for the element are empty.

A quick workaround is to remove of the normal keywords (or all of them, since they are redundant: all sub-properties not set explicitly in a font shorthand are set to their initial values).

P.S. Your code is correct, Firefox just does not handle it well. As a reference to font shorthand syntax (if you use it), use the W3C CSS 2.1 specification.

Upvotes: 1

Ian Hazzard
Ian Hazzard

Reputation: 7771

For FireFox, you should set all the properties without using the shorthand property. font: is the shorthand property for many other font properties:

Instead it should look like this:

font-family: monospace;
font-size: 20px;
font-weight: bold;
color: blue;

http://www.w3schools.com/css/css_font.asp

http://www.w3schools.com/cssref/pr_font_font.asp

Upvotes: 1

Related Questions