Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write fractions in html? [duplicate]

Tags:

html

How to write fractions in html? I want to write some like this.."3 ½ years" in html. How to do it?

html:

  <html>
      <body>
          <p>3 1/2 years</p>
      </body>
 </html>
like image 499
Nag Avatar asked Feb 06 '23 15:02

Nag


2 Answers

You can use;

&frac12;  3 ½

or you can use ASCII character code;

&#189;   3 ½

Hope helps;

like image 129
Berkay Yaylacı Avatar answered Feb 15 '23 15:02

Berkay Yaylacı


You can try this:

 3<sup>1</sup>&frasl;<sub>2</sub>years
like image 21
Geeky Ninja Avatar answered Feb 15 '23 14:02

Geeky Ninja