+ 1

How do I make superscript and subscript text in HTML?

How do I make superscript and subscript text in HTML?

12th Jul 2022, 3:43 PM
πŸ‡ΊπŸ‡¦ AJ #PeaceForUkraine πŸ‡ΊπŸ‡¦
πŸ‡ΊπŸ‡¦ AJ #PeaceForUkraine πŸ‡ΊπŸ‡¦ - avatar
3 Answers
+ 3
By putting the text inside <sub></sub> or <sup></sup> tags.
12th Jul 2022, 4:00 PM
Avinesh
Avinesh - avatar
+ 1
And you can also apply CSS and do absolutely the same, especially since you can customize the text and make it superscripted or subscripted as you want by using pixels. ( positive value for superscript, negative value for subscript ) Look: <style> <!β€” for superscripted text β€”> p{ vertical-align: sup; } <!β€” for subscripted text β€”> p{ vertical-align: sub; } <!β€” for superscripted text β€”> p{ vertical-align: 10px; } <!β€” for subscripted text β€”> p{ vertical-align: -10px; } </style> I hope this helped you!( for more explanations, you can read lesson 14.1 of the CSS course ) ^^ Have a good day!
12th Jul 2022, 5:05 PM
Vlad Apet
0
Thanks!
12th Jul 2022, 6:08 PM
πŸ‡ΊπŸ‡¦ AJ #PeaceForUkraine πŸ‡ΊπŸ‡¦
πŸ‡ΊπŸ‡¦ AJ #PeaceForUkraine πŸ‡ΊπŸ‡¦ - avatar