Bug Tracker

Modify

Ticket #7306 (closed bug: invalid)

Opened 3 years ago

Last modified 2 years ago

Incorrect width in Webkit browsers when element has an image and is floated

Reported by: mauriciomantilla@… Owned by:
Priority: low Milestone:
Component: dimensions Version: 1.4.3
Keywords: width float img Cc:
Blocking: Blocked by:

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/

Change History

comment:1 Changed 3 years ago by SlexAxton

  • Keywords width float img added
  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to offset

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.

comment:2 Changed 2 years ago by john

  • Status changed from open to closed
  • Resolution set to invalid

I agree that this sounds like a CSS issue, no so much a jQuery issue.

comment:3 Changed 2 years ago by john

  • Component changed from offset to dimensions

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.