"Ernest Cline" <ernestcline (AT) mindspring (DOT) communism> wrote:
Quote:
"Scott" <sbpickering (AT) charter (DOT) net> wrote:
How do i use html code to place a superscript directly above a
subscript (needed for chemistry)
Depends on what you mean by HTML code. |
Well, "HTML code" is a pretty well-defined concept, and the answer is
"no way".
Quote:
If you allow the use of CSS or SVG or MathML, there are any number
of solutions to your problem. |
What the OP "allows" is irrelevant. It does not change the meaning of
"HTML code". But in CSS and in other non-HTML notations, there are
different ways of approaching the problem. The problem is essentially
presentational, so it is not a good idea to look for an HTML solution.
Quote:
If you mean just HTML, then the only
thing I can think of would be a kludge involving the use of
table>. |
Well, instead of positioning a superscript, the kludge uses no
superscript whatsoever.
Considering a "formula" like
<span class="formula">O<sub>3</sub><sup>-</sup></span>
(i.e., letter O with subscript 3 and superscript -), if you would like
to make the superscript appear above the subscript, you could use
..formula { line-height: 1.8; }
..formula sup { margin-left: -0.7ex; }
in a stylesheet. The margin-left property effectively shifts the
superscript to the left, and the line-height property is useful for
defeating some IE bugs (and fairly natural, since you are using quite
some height here, more than we can expect to be available by default).
--
Yucca,
http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring:
http://www.cs.tut.fi/~jkorpela/www.html