On Mon, Jan 25, 2010 at 12:42 PM, Troy Harshman <[email protected]> wrote:

> Well, you've got everything wrapped in a fixed width div. So why not
> do some math and set widths to your content divs and then position
> with margins?
>
> On Mon, Jan 25, 2010 at 12:29 PM, Michael Beaudoin <[email protected]>
> wrote:
> > Ok. An easy one for some of you on a Monday, but I'm just not seeing it.
> >
> > I have a div (content) and would like to center two other divs
> > (leftContent and rightContent) within the content div.
> >
> > I've tried all the obvious things but they aren't working for me.
> >
> > Thanks,
> > Michael
> > ______________________________________________________________________
> > css-discuss [[email protected]]
> > http://www.css-discuss.org/mailman/listinfo/css-d
> > List wiki/FAQ -- http://css-discuss.incutio.com/
> > List policies -- http://css-discuss.org/policies.html
> > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
> >
> ______________________________________________________________________
> css-discuss [[email protected]]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>

I don't think you'll be able to do it while the inner divs floating. if you
wrap the two inner divs in a fixed width one that isn't floating you could
do it. you'd just have to clear that containing div. so you could try
something like this.

<div id="content">
     <div id="inner-content">
          <div id="leftContent" />
          <div id="rightContent" />
     </div>
</div>

then use a clear fix for the inner-content and set your width and add your
margin: 0 auto.

but i agree that it would be easier to set it with margins or padding.

- Jeff
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to