I have an element with a line-height set with calc()
:
line-height: calc(3rem / 2);
Demo: http://codepen.io/Ghodmode/pen/vLxZZd
It works fine in Chrome, but Firefox's Developer Tools says that it's an invalid property value.
I'm sure I'm missing something that should be obvious.
Just for reference:
To fix that, copy the code directly from you IDE to some "Hidden Character" detector like this one https://www.soscisurvey.de/tools/view-chars.php ,delete the 'bad' characters and then save your code again without the bad characters.
CSS calc() is a function used for simple calculations to determine CSS property values right in CSS. The calc() function allows mathematical expressions with addition (+), subtraction (-), multiplication (*), and division (/) to be used as component values.
This is a known issue. Firefox does not currently support calc()
values on properties that accept either lengths or numbers, of which line-height
is one such property. See bug 594933.
Since 3rem / 2 is exactly 1.5rem you can just hardcode that amount instead as a workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With