Re: position: center

On Tuesday 27 January 2004 18:13, David Woolley wrote:
> 
> >    What?  I don't understand why each individual line of text would be 
> > in the vertical centre, therefore overlapping each other.  For 
> 
> Not what I said.  Inline text is broken into single line boxes.
> These boxes are then justified within their own line according
> to the text-align property, and constrained by the block that
> contains all the lines.  Trying to vertically justify a single
> line can only affect that line.  That is the consequence of the
> CSS layout model.
> 
> The effect that most people want with vertical centring is 
> the analogue of horizontally centring the containing block,
> rather than horizontally justifying the text in an individual 
> line.  I.e. they want an analogue of:
> 
> display: block; margin-left: auto; margin-right: auto; width: <width>
> 
> I'm not completely sure that that analogue is not already valid.  I.E.
> 
> display: block; margin-top: auto; margin-bottom: auto; height: <height>

The simple solution to this is to not apply this to every single line- it 
should be, yes,  just as if you were setting the top-margin to 'auto', the 
problem being that currently setting the margin to 'auto' will favor the 
top-left corner. We need a way to set a margin to "auto", but with a way to 
imply what we really mean: "set this margin the same as the other margin", or 
possibly (for top-align, bottom-align) "set this margin to as much as would 
be required to fill up to the side of the parent box, after the other side's 
margin has been applied" (similar to a FRAMESET's width=*)

So what I'm getting at is, there is no reason whatsoever to individually 
position each line when trying to align vertically the containing block. 
Rather, look at the first-line and the last-line (for example, the first-line 
psuedo element), and apply the auto margins to them. To say that it would 
work otherwise is counter-inuitive- otherwise margins in general would be 
impossible. We just need auto-margins which don't favor the top-left corner.


> >    Vertical positioning doesn't necessarily require a fixed box size, it 
> > simply requires that the size of the box be calculated before rendering 
> > can begin or continually reflow while rendering, until complete.  Since 
> > this is done anyway as rendering occurs, this should not a problem.
> 
> But this is an undesirable behaviour in a medium with the typical writing
> speed of a web page as it makes the page difficult to read as it
> is rendering.  (I know that most authors use tables with (default) 
> options that force delayed rendering, but I consider that an endemic
> fault in web page design.)
> 
> 

It's not optimal to have your page not start displaying data instantly, true. 
I guess beyond that it's just a matter of priorities- "Do I want my page to 
load fast" vs "Do I want my page to look good". That question is never going 
to go away- and should be handled by the designer, not by a web standard.
If it isnt included at all, it's removed from many situations where your 
argument doesnt even apply. (I'd personally use it for very short blocks of 
text, for example). 

Tables make code huge and ugly, but if CSS can't do this, there will be a 
bunch of pages out there continuing to use
<TABLE WIDTH="100%" HEIGHT="100%"><TR><TD ALIGN="RIGHT" 
VALIGN="BOTTOM">Content Content Content</TD></TR></TABLE>

Received on Tuesday, 27 January 2004 19:31:24 UTC