Re: vertical-align (5.4.4)
At 10:39 AM 12/13/96 -0800, David Perrell wrote:
>Jim King wrote:
>> what happens with a line that has multiple inline elements (such
>>as three gifs of equations in one line.) Would that % be 20% of the
>>overall line-box plus the leading, or would it be 20% of the
>>line-height ONLY at the point where the image is located (which is
>>different from the line-height 2 characters earlier)? 4.4 seems to
>>imply that the line is sectionalized such...
>I think you're confusing line box with line-height. Inline elements may
>change the height of the line box in which they occur, not their
Ah! After re-reading it, I think I understand my mistake. I missed that
replaced items have no line-height property. So I assume that a
'vertical-align: -20%' would adjust an image downward by 20% of the parent's
line-height, having nothing to do with the height of the object itself.
>I believe you could accomplish this using a SPAN element with a
>line-height set to a pixel measurement and a vertical-align of
>'baseline'. You would then nest your IMG within the span, such that the
>image is a child of an element with a known line-height.
will work much better. So:
<P>This is a sentence with an inline equation:
<SPAN STYLE="line-height: 12">
<IMG STYLE="vertical-align: -25%" SRC="equation.gif">
would shift the equation down by 3 points. The only problem is that the
height of objects themselves are usually defined relative to the canvas (in
pixels), so a value in points seems pretty useless. As long as
implementations allow all units in 'height' and 'width' we'd still be OK.
>A vertical-align with absolute length units would be much simpler. Odd
>that this property is limited to computed values. (Can anyone comment
>as to why this is so?)
I agree, but why not just allow all units that are allowed in other places
(as defined in 6.1). This would be more consistent throughout the whole
spec. Then you could use:
<P>This is an inline equation:
<IMG STYLE="height: 19pt; width: 35pt; vertical-align: -3pt"
Seems more useful since now you can have consistent units within your whole
IMG or OBJECT item. I think the more traditional (html-wise, not
typesetting-wise) thing you would see would be:
<P>This is an inline equation:
<IMG STYLE="height: 120px; width: 300px; vertical-align: -45px"
You could still keep the % as it is now defined, since it makes sense to
have something relative to the parent, but now you would have both options.
Does this make sense to anyone? I've been racking my brain for quite a
while to try to make equations line up in HTML with our products the way we
have done for years with MS Word, Nisus Writer, etc..., and this would
certainly allow us to solve the problem (not to mention allow the HTML-MATH
group to solve it once that spec is completed). Plus it would give greater
typographic control without much cost.
Design Science, Inc. Sales: email@example.com
4028 Broadway Support: firstname.lastname@example.org
Long Beach, CA 90803
USA World Wide Web:
voice: 310-433-0685 http://www.mathtype.com