Dave Merrill wrote:
> >> I'd like [a] div to auto-size its width to accommodate the
>content. "display: table" works for current versions of Opera and
>Firefox, but not IE. I can set the width explicitly, but that
>doesn't accommodate variations in rendered font size, or the user
>changing text size manually.
> >> What other choices do I have?
> > if it's just font size variation you're concerned about, you
>could set the width of the div in em units...
>Is that the only way? There's no other way to get IE to auto-size the width
>of a div to hold its contents.
Of a DIV? Yes, that's the only way.
You could, of course, make the element an actual table. Then IE will
apply the auto-width algorithm, and since compliant browsers
obviously apply "display: table" to actual tables, everyone will
agree on what to display. Of course, this messes up your semantics a
bit, but if this is a deal-breaker for you, you do what you have to.
There are no plans in the W3C to make any changes to the spec, by the
way, since this is an implementation issue. The spec already allows
you to do what you want, even if the browsers don't.
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/