#4869 closed bug (worksforme)
ie & Firefox: setting a div's width to its own current width will cause text content to wrap
Reported by: | patrickwhalen | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | firefox width text wrap | Cc: | |
Blocked by: | Blocking: |
Description
- Create a div that is floated left (or has some other css attribute that will cause its width to reduce to its content).
- Place a sentence of text inside the div.
- Get the div's width. var theWidth = $('#myDiv').width();
- Set the div's width to the value retrieved in step 3. $('#myDiv).css({width: theWidth});
Firefox result: Even though the width of the div hasn't changed, the text will wrap as though the div has been reduced in width. Tested Firefox 3 and 3.5 on mac os x.
ie result: The width of the div reduces each time by the size of the left and right borders. As though when getting the width, it subtracts out the border, so that when setting the width with that size, it is actually reducing it by the amount that was subtracted out. Tested ie 7 & 8 on xp.
webkit and opera are not affected.
Attachments (1)
Change History (2)
Changed 14 years ago by
Attachment: | width_anomalies.html added |
---|
comment:1 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
http://jsfiddle.net/dmethvin/LSgdW/