Skip to main content
Feb 21, 2010 8:32 AM UTC
Answered

Superscript and Subscript

How to apply superscript and subscript for the content to be fetched from the xml file?

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer
Feb 21, 2010 6:07 PM UTC

If the font has super- and subscript glyphs, you can use specific values of the baselineShift attribute:

<span>normal </span><span baselineShift="superscript">super</span><span baselineShift="subscript">sub</span>

If your font does not have these glyphs, you can simulate super- and subscript by decreasing the fontSize and setting baselineShift to an appropriate number.

1 reply

Correct answer
Feb 21, 2010 6:07 PM UTC

If the font has super- and subscript glyphs, you can use specific values of the baselineShift attribute:

<span>normal </span><span baselineShift="superscript">super</span><span baselineShift="subscript">sub</span>

If your font does not have these glyphs, you can simulate super- and subscript by decreasing the fontSize and setting baselineShift to an appropriate number.

Translate