Reputation: 637
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)
Upvotes: 7
Views: 3849
Reputation: 2205
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
Upvotes: 3