On 01/11/06, Mark Wheeler <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Is this even possible? (I'm sure it is, but I still feel pretty new
> to css) - Can you have a div (content) centered inside another div
> (container) BUT, the content div's width may be different because of
> content (thus you can't set the width) AND the div width must
> collapse around the content (so if a border was used, it would
> collapse around the content)? I can't figure this out. I'm sure there
> is a simple solution, but I can't seem to get there. Any help would
> be appreciative.
>
> Thanks,
>
> Mark
Yes, it's possible, but unless you want to get into some rather complex CSS,
the container has to have a fixed width.
#container {
width:800px;
}
#content {
margin:0 auto;
border:2px solid red;
}
That will do what I think you're after. #content will stretch depending on
its content. Hope it helps,
Rafael
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/