How do I style the container so that its width adjusts to the fixed size of the inner-container?
Thanks!
John
CSS
Last Comment
John Carney
8/22/2022 - Mon
Mark Steggles
Hello,
You cant make a div do that. Is the inner container always going to have that width? Cant you just give the outer container a width of say 640px
Thanks
John Carney
ASKER
So you can do it with height but not width? I guess the only way to do it would be to make your container a one cell table. Is that considered to old-fashioned to do nowadays?
I stumbled upon a stupidly simple solution that works in Firefox, Chrome and Safari, and almost works in Opera: give container the style "display:table" as Kravimir suggested, AND a width less than its child. (display:table alone doesn't work, at least not for me).
Of course it doesn't work at all in IE, but it's very tantalizing, so I'm wondering if it triggers something in you that would be an all-purpose answer. Here's what I mean: http://www.discretedata.com/JCPortfolio/testAuto2.html
You cant make a div do that. Is the inner container always going to have that width? Cant you just give the outer container a width of say 640px
Thanks