I might be reading your problem wrong, but most people usually center
div's using

div#mydiv { margin-left: auto; margin-right: auto; }

So you might have:

<div style="width: 1000px;">
  <div style="width: 500px; margin-left: auto; margin-right:
auto;">foo bar!</div>
</div>

And the inner div would be horizontally centered within the larger, outer div.

Clint

On 10/31/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
> ______________________________________________________________________
> 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/
>

-- 
Clint Ecker
http://phaedo.cx
312.863.9323
______________________________________________________________________
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/

Reply via email to