W3C home > Mailing lists > Public > www-style@w3.org > January 2008

RE: Proposal: text-vertical-position property

From: David Perrell <davidp@hpaa.com>
Date: Thu, 24 Jan 2008 01:24:27 -0800
To: <www-style@w3.org>
Message-ID: <HIEDLECHAFDEPLGKECDDEEKEAAAB.davidp@hpaa.com>

David Baron wrote:
| David Perrell wrote:
| > This property specifies the vertical position of text in line
| boxes within the element.
|
| Do you mean line boxes or inline boxes?  If you mean line boxes,
| you'd need to define how this property interacts with
| 'vertical-align', since they do very similar things. If you mean
| inline boxes (which I *think* you do), I'd think you'd need to
| define how it moves the inline box in some cases (for example,
| you'd still want the baseline of text baseline-aligned, so you'd
| want the inline box to move around the text, rather than the text to
| move within the inline box).

I must mean inline boxes, since text never occurs outside one. Also, to
affect the anonymous inline boxes without causing them to reposition for
baseline alignment, this property would have to inherit from the block
container to the inline boxes and be applicable to all elements, wouldn't
it? Obviously my proposal needs editing.

I'd want the text to move up/down within the inline box. By having the
property inherit, text in all inline boxes would be positioned accordingly.
I don't see baseline alignment as an issue.

| That said, what are the use cases for this?  When is it useful?
| (Can it be useful in cases where the author doesn't necessarily know
| what fonts are going to be used?)

I want equal space above and below a block of text with a background color.
I will not be using any accented uppercase letters. I do not want any extra
space above the first line of text. Currently, I'm out of luck. With FF and
Opera there will always be an empty area reserved for diacritics visually
pushing the lines of text downward in the block. I need
'text-vertical-position: ascdesc'.

I'm using only uppercase letters in multi-line subheads. My font-family
alternates have varying baseline positions within their bounding boxes. I
need 'text-vertical-position: capheight'.

On the page where I 'fudged' positioning to make it appear that a single
line of text was centered vertically on ascenders and descenders
(http://www.hpaa.com/css2/span.htm), I had initially added padding based on
metrics for my first-choice font: "Swis721 BT". The metrics were enough
different from Arial or Helvetica that those viewing the page with alternate
fonts did not see the text vertically centered. With
'text-vertical-position: ascdesc', fudging would be unnecessary and unknown
font metrics would not be a concern.

Currently, even a single line of text cannot be visually centered vertically
in a line box in a way that an author can be assured that it will appear so
on all user agents. Text-vertical-position defines a default positioning
method and offers a full range of alternatives.

David Perrell
Received on Thursday, 24 January 2008 09:25:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:59 GMT