I'm calling getComputedStyle on an element that defines left, right and bottom.
In Chrome this returns 'auto' as the value for top but in Firefox this returns the pixel value, however if you look at the inspector in Firefox the top value doesn't show up in the computed pane.
Is there any way to workaround this? Here is a fiddle showing the issue http://jsfiddle.net/DEfusion/9NaGD/
Via: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle
In Firefox, properties with the value auto return the used value, not the value auto. So if you apply top:auto; and bottom:0; on an element with height:30px and its containing block is height:100px;, upon requesting the computed style for top, Firefox will return top:70px, as 100px-30px=70px.
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