Html superscript and subscript

any ways to insert in html using css superscripts or subscripts like: ยน or โ‚ (I also need latin letters).

+4
source share
5 answers

HTML TAGS: try sup and sub tags, ...

Demo

Another option Using css:

<style type="text/css"> #sup, #sub { height: 0; line-height: 1; vertical-align: baseline; _vertical-align: bottom; position: relative; } #sup { bottom: 1ex; } sub { top: .5ex; } </style> 
+5
source

Use the <sup> and <sub> tags.

+10
source

Check out this link about CSS superscript and index:

Superscript and Subscript | HTML Dog

0
source

I'm not quite sure what you want with the Latin letters, or if you know what the Latin letters are, but you can find Unicode here http://unicodelookup.com/#latin

If you mean Roman numbers, there is no automatic translation in HTML except ol

0
source
 <style> .sub, .sup { position: relative; font-size: 80%; } </style> ... <span class=sub>a</span> (subscript) <span class=sup>a</span> (superscript) 

Adjust the values โ€‹โ€‹as desired. In particular, you can use different classes for different situations, especially depending on the letter to which the superscript is attached. For example, after an uppercase letter such as โ€œA,โ€ the inscription should be placed much higher.

Why classes and CSS?

Although HTML seems to have only the correct markup for this, sup and sub , they have a few drawbacks. Their rendering is inconsistent in browsers and is often typically poor: both vertical placement and size may be insufficient. It may seem easy to fix this in CSS, but it is not, due to an odd IE error with their calibration: it incorrectly interprets percentages. Moreover, sup and sub often create an uneven line spacing.

If you intend to use sup and sub , run a few tests before using them. Check multiple browsers and superscripts and indexes inside paragraphs of text (so you see a problem with line spacing).

0
source

All Articles