N
Nick Wedd
Suppose I want to position one character over the top of another. For
example, suppose I want to put a V over the top of a W, and centred on
it. I can do it like this:
<style type="text/css">
span.ova { position: absolute; }
span.ovr { position: relative; left: -0.84em; }
</style>
....
W<span class=ova><span class=ovr>V</span></span>
This works. Ok, it isn't pretty, and the correct value of "left"
depends not only on the widths of "W" and "V" but on the font and on the
browser. But I am happy enough with the results (though I'll be pleased
to hear a better way to get the same effect).
But it goes wrong if the text line is made a non-standard height by the
use of, say, a superscripted character. See
http://www.maproom.co.uk/test.html for a minimal example. The W is
positioned where I would expect, and the V still has the correct
horizontal displacement, but the V goes up in the air to align itself
with the superscript.
Can anyone recommend a better solution?
Nick
example, suppose I want to put a V over the top of a W, and centred on
it. I can do it like this:
<style type="text/css">
span.ova { position: absolute; }
span.ovr { position: relative; left: -0.84em; }
</style>
....
W<span class=ova><span class=ovr>V</span></span>
This works. Ok, it isn't pretty, and the correct value of "left"
depends not only on the widths of "W" and "V" but on the font and on the
browser. But I am happy enough with the results (though I'll be pleased
to hear a better way to get the same effect).
But it goes wrong if the text line is made a non-standard height by the
use of, say, a superscripted character. See
http://www.maproom.co.uk/test.html for a minimal example. The W is
positioned where I would expect, and the V still has the correct
horizontal displacement, but the V goes up in the air to align itself
with the superscript.
Can anyone recommend a better solution?
Nick