On 23/06/10 02:18, Tim Climis wrote:
> On Tuesday, June 22, 2010 8:06:27 pm martin wrote:
>   
>> Hi all
>>
>> I'm trying to center 3 float:left boxes in the middle of the main
>> container.
>>     
>
> This might be pretty simple, actually...  Untested, but give:
>
> #container {
>   float: left;
>   margin: 0 auto;
> }
>
> a try.
>
> Theory: once you float the container, it will shrink to fit all the other 
> boxes.  
> I'm pretty sure that the rules of float will still keep the three floated 
> columns next to each other. And then the margin: auto centers the whole thing.
>
> If you need the main container wider than the three columns, you can add 
> another container div (#column_container or similar).
>
> ---Tim
> ______________________________________________________________________
> css-discuss [cs...@lists.css-discuss.org]
> 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/
>   


Thanks, but what it did was floating the container to the left (well, as
it's supposed to do), but I want to keep the
container in the middle of the screen.

regards
Martin
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
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