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/
>

Mark,

I am a beginner myself. However, the answer to your first question is
yes, just add the attribute:
text-align: center;
in your css file into the overall div that is containing the content
div. Now, if you set a border around your container div, then the
border should always collapse around your content. However, as for
differing sizes on your content, that sounds like a fluid layout, and
I am guessing that IE will give you many problems.

My suggestion is use a fixed width on all of your pages to remain
consistent. Generally, this makes the website more professional
looking (IMHO).

Can you give us a mock up or an example site that you want this happen
on? It would make it a lot easier I believe for all us.

Good Luck,
Martin
______________________________________________________________________
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