Skip to main content
February 21, 2010
Answered

Superscript and Subscript

  • February 21, 2010
  • 1 reply
  • 1188 views

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

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
February 21, 2010

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.