In my non-fixed layouts, I like to set max-width on main content objects to prevent lines of text from getting unreadably long in the event somebody maximizes their window on a huge widescreen monitor.
Only problem comes when, on occasion, I have a bit of content in the body that is wider than the max width, either a large image or a table. The object will overflow its container in this case, which is obviously not the desired effect; I'd rather the contained object's width overrode the max-width setting on the container.
Some Googling turned up the suggestion to float the container, which will induce this behavior, but I'm having trouble actually applying that to more complex layouts. Is there some better and/or more clever way of doing this? What do y'all do in this situation?
(On a semi-related side note, out of sheer curiosity I tried giving a display: float property to the body element, which seemed to completely override the max-width of contained elements. Weird, but interesting--I wonder what's inducing that behavior.)
Only problem comes when, on occasion, I have a bit of content in the body that is wider than the max width, either a large image or a table. The object will overflow its container in this case, which is obviously not the desired effect; I'd rather the contained object's width overrode the max-width setting on the container.
Some Googling turned up the suggestion to float the container, which will induce this behavior, but I'm having trouble actually applying that to more complex layouts. Is there some better and/or more clever way of doing this? What do y'all do in this situation?
(On a semi-related side note, out of sheer curiosity I tried giving a display: float property to the body element, which seemed to completely override the max-width of contained elements. Weird, but interesting--I wonder what's inducing that behavior.)