Side navigation
#7306 closed bug (invalid)
Opened October 25, 2010 02:48PM UTC
Closed April 17, 2011 06:41PM UTC
Last modified April 17, 2011 06:41PM UTC
Incorrect width in Webkit browsers when element has an image and is floated
Reported by: | mauriciomantilla@gmail.com | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | dimensions | Version: | 1.4.3 |
Keywords: | width float img | Cc: | |
Blocked by: | Blocking: |
Description
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/
Attachments (0)
Change History (3)
Changed October 25, 2010 07:57PM UTC by comment:1
component: | unfiled → offset |
---|---|
keywords: | → width float img |
priority: | undecided → low |
status: | new → open |
Changed April 17, 2011 06:41PM UTC by comment:2
resolution: | → invalid |
---|---|
status: | open → closed |
I agree that this sounds like a CSS issue, no so much a jQuery issue.
Changed April 17, 2011 06:41PM UTC by comment:3
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.