Adham
Adham

Reputation: 64844

How to make text appears alitter above using html and css

For example 2nd, I want to make the nd appears bit above using html and css. how ?

Upvotes: 0

Views: 132

Answers (5)

Murugan Kumarasamy
Murugan Kumarasamy

Reputation: 161

<p>2 <sup>superscript</sup> text.</p>
<p>2 <sub>subscript</sub> text.</p>

Upvotes: 1

Prabhakaran Parthipan
Prabhakaran Parthipan

Reputation: 4273

<sub> tag defines subscript text. Subscript text appears half a character below the baseline. Subscript text can be used for chemical formulas, like H2O.

<sup> tag defines superscript text. Superscript text appears half a character above the baseline. Superscript text can be used for footnotes, like WWW[1].

Upvotes: 1

Jordan Eldredge
Jordan Eldredge

Reputation: 1707

From the department of Hilariously Bad Ideas: You could use UTF8 superscript characters!

2ⁿᵈ

Upvotes: 0

user1509341
user1509341

Reputation: 164

Try this:

  2<span style="vertical-align: super;">nd</span>

Using the vertical-align should do the trick.

Upvotes: -1

Madara&#39;s Ghost
Madara&#39;s Ghost

Reputation: 174957

Use <sup> (and <sub>, for the opposite effect)

2nd H2O

Upvotes: 2

Related Questions