It seems to be that the table within the div or body element is pushing the content out beyond the specified widths in Internet Explorer. If I set the width on the table to 100% it forces the containing dom element to expand if the elements within the table can possibly have a width to do so (that is to say that the text contained therein [rather than wrapping as it does in other browsers] forces the cell, and therefore table to expand beyond the set boundaries of the parent dom element).
On Mon, Mar 23, 2009 at 10:50 AM, Jack Blankenships <learningcssindet...@gmail.com> wrote: > After experimenting some more I have come up with some code that seems > to work in most browsers: > > .content { > width: 100%; > max-width: 960px; > min-width: 640px; > margin-left: auto; > margin-right: auto; > } > > This can be applied to a body or div tag with an embedded table and > will center the element with a minimum width of 640px and a maximum > with of 960px while expanding to 100% of the available viewport within > the given bounds -- but it does not work for Internet Explorer. > > I have tried: > > .content { > width: 100%; > max-width: 960px; > min-width: 640px; > margin-left: auto; > margin-right: auto; > width: expression(this.width > 960 ? 960 : this.width < 640 ? 640 : true); > } > > As recommended by others, but that does not seem to work. Any > suggestions as to how to make this work in Internet Explorer without > some drastic hacks, etc.? > > Thanks, > Jack > > > On Mon, Mar 23, 2009 at 10:26 AM, Gunlaug Sørtun <gunla...@c2i.net> wrote: >> Jack Blankenships wrote: >>> >>> Apparently there was a table there as well, and max-width does not apply >>> to a table very nicely in Safari or Internet Explorer. Can anyone offer >>> some more explanation on this? >> >> Have only tested for CSS table a year or so back, and it's a known >> behavior in Safari 3. I haven't tested how neither IE7 nor IE8 handles >> max-width on HTML table, or how IE8 handles it on CSS table. >> >> Some browsers seem to ignore min/max-width on table - which seems ok, >> while others apply it - which also can be justified I think. So, I don't >> think Safari and IE8 are wrong, or right, since min/max-width on table >> seems to be in undefined or under-defined CSS territory. >> >> regards >> Georg >> -- >> http://www.gunlaug.no >> > ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/