The first example you gave is designed to work for any situation. It works
for items that have fixed widths or liquid widths (based on the width of the
viewport). And yes, it is not as elegant as it should be.

However, if you have a liquid layout, there is a much simpler method that
only needs two declarations on the containing block:

#container 
{
margin-left: 10%;
margin-right: 10%;
}

These two declarations are not needed:
width: 80%;
text-align: left;

Russ




> Just been reading about center align, and its problems
> The recommendation is
> 
> 
> margin-left: auto;
> margin-right: auto;
> width: 80%;
> text-align: left;
> and a hack
> body { text-align: center; }
> 
> I have always been using
> 
> left: 10%;
> right: 10%;
> width: 80%;
> text-align: left;
> Which seemed to work in all browsers, is this not easier? Is there any reason
> why I should not do it that way, and work with the hack instead? (just
> wondering)
> 
> Taco Fleur
> Tell me and I will forget
> Show me and I will remember
> Teach me and I will learn
> 
>

*****************************************************
The discussion list for http://webstandardsgroup.org/
***************************************************** 

Reply via email to