#11584 closed bug (invalid)
outerWidth(true) inconsistent on float: none; margin: auto;
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | dimensions | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
outerWidth(true) returns an inconsistent value between browsers when a DIV has no float and auto margins.
Details in the JSFiddle, load in all browsers available to see inconsistency.
Change History (3)
comment:1 Changed 11 years ago by
Component: | unfiled → dimensions |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 11 years ago by
So cross browser consistency is not desired in jQuery? That seems bizarre.
comment:3 Changed 11 years ago by
Of course it's desired. The problem here is that browsers differ here in a way that makes it impossible for us to fix. I've already petitioned the browser vendors to fix this.
What's funny about this fiddle is that it says the "correct" value is 200px. However, when margin is "auto", the value is greater than zero. That's what centers the box. That's why you said auto. The correct value is actually what Chrome reports, 836.
For more information, see here: https://bugzilla.mozilla.org/show_bug.cgi?id=381328 https://bugs.webkit.org/show_bug.cgi?id=73334
.outerWidth(true) will return the width including margins. Since you've set the margin to auto, the margin will fill the width of the window.