On 12/2/11 8:01 PM, Stevio wrote:
Thanks for the suggestions. I am trying to develop a flexible layout (so
I do not want to set a width for the parent element) for web sites that
will be used in conjunction with a content management system. The width
of child element will therefore be unknown as well depending on what
content and images have been entered.

I would much rather that the browser's horizontal scrollbar appear for
the page than have the content stick out the side which looks very ugly
and messy.

Even if I specify a % for the child element, the contents of the child
element may be greater in width.

I have found a solution and that is to use display:table-cell. Even in
2011, there are still situations where the use of tables in one form or
another still trumps other display options lol. If you want something
that expands and contracts to fit its contents, tables (the CSS variety)
still seem to be the best option.


FWIW "display: inline-block;" "float: left|right;" "position: absolute;" also exhibit a shrink-to-fit behavior. As already mentioned, "max-width: 100%;" on the child element may stop it poking out of the parent.

CSS gives you many options. :)
--
Cordially,
David




*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************

Reply via email to