Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML - text position like squared number

Tags:

html

css

symbols

As I found this for squared symbol numbers.

Is it maybe possible to have some [text] like number two is presented in example?

Like here if you put:

²

in HTML code you got: 2²

like image 370
watata55 Avatar asked Jun 11 '26 01:06

watata55


2 Answers

Put those characters after the text you want or your can use <sup> tag around 2.

2&#178;

2<sup>2</sup>
like image 69
Dumisani Avatar answered Jun 16 '26 19:06

Dumisani


This is called Superscript and actually there is a special HTML element just for this task: <sup>

You simply need to wrap your desired text inside <sup></sup>

Here's an example:

<span>my<sup>text</sup></span>
like image 40
obscure Avatar answered Jun 16 '26 20:06

obscure



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!