I'm trying to get the width of an element using element.outerWidth
. When I'm using Chrome it returns a correct value, but when I'm switching to firefox I got a much lower value. In what way does firefox read this element different from chrome?
Element:
<div class="submit_container">
<input type="submit" value="Something" />
</div>
Chrome: 88px
Firefox: 36px
When I inspect the element using firefox it display the same with as in chrome. (88px)
Have you tried using jQuery width?
$(element).width();
It has a slight difference but I guess it's a cross-browser issue.
EDIT:
I think the line-spacing
was the one causing the difference in width. Try removing it in Firefox and you'll see the difference
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