Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

css rem unit not working with font declarations

css rem unit not working with font declarations

Problem

This css Property is not working on IE10:

font: bold 3rem/6rem Arial;

However, if I split this property to separate properties it works:

font-size: 3rem;
font-weight: bold;
line-height: 6rem;
font-family: Arial;

I can also use PX instead and it also works:

font: bold 48px/96px Arial;

You can try it on every page with IE debugger. Why is this property not working on IE but on all other browsers?

Problem courtesy of: user1224129

Solution

The rem unit is not supported in IE for the Font shorthand. It is a known bug. Hopefully this will be fixed. The only work-around I know is to specify the font-size again after the font property, or not use the shorthand when using rem.

The bug report is https://connect.microsoft.com/IE/feedback/details/772679/ie10-not-recognizing-font-decloration-when-rem-is-used-as-font-size-unit-of-measure

Update: note that this has been fixed as of IE11.

Solution courtesy of: David Storey

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

css rem unit not working with font declarations

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×