0

The text Kasparov and 1 written somewhat above to it

How do I format this in a HTML page? What is the tag for it? I don’t know how to get this 1 written above the text.

TRiG
  • 10,148
  • 7
  • 57
  • 107
Asis
  • 183
  • 3
  • 15
  • POssible duplicate of https://stackoverflow.com/questions/1530685/html-sup-tag-affecting-line-height-how-to-make-it-consistent – Athul Nath Mar 14 '18 at 06:03

2 Answers2

3

Probably the <sup> element for superscript text.

Likethis.

<p>Like<sup>this</sup></p>

There's also <sub> for subscript text:

Likethis.

<p>Like<sub>this</sub></p>

Note that these elements are meant for actual textual superscript and subscript text. Remember that HTML is semantic: it describes what the content is, not what the content looks like (that's what CSS is for).

In CSS you can do this the simple way by setting vertical-align: super with font-size: 80% on an inline-element (like <span> but not <div>, a block-element).

Another approach is to do it manually with creative use of margin or position: relative - in which case it depends on your application.

Dai
  • 141,631
  • 28
  • 261
  • 374
1

Using the SuperScript tag

Kasparov<sup>1</sup>

Kasparov1

AurA
  • 12,135
  • 7
  • 46
  • 63