Incorrect width in Webkit browsers when element has an image and is floated
If you have a div which is floated and contains an image, then the width of the div is the same as the image width.
However, when using .width(), the returned value is 0 in Chrome and Safari and another incorrect value in Opera. In Firefox and IE it's working fine.
Here's a test case: http://codigoweb.co/jquery_width_test/
Change History (3)
Component: |
unfiled →
offset
|
Keywords: |
width float img added
|
Priority: |
undecided →
low
|
Status: |
new →
open
|
Resolution: |
→ invalid
|
Status: |
open →
closed
|
Component: |
offset →
dimensions
|
I'm not sure of the exact case that is correct here. It may depend on whether your img is inline or block...
Either way, there should be consistent results across browsers, so I'll go ahead and open this up.