How to write fractions in 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>
+4
source share
4 answers

You can use;

&frac12;  3 Β½

or you can use the ASCII character code;

&#189;   3 Β½

Hope helps;

+2
source

You can use this code:

½

Then your code should look like this:

<p>3 ½ years</p>

3 & frac12 years

+2
source
ΒΌ   &frac14;
Β½   &frac12;

Just enter the nominee and denominator at the end

+1
source

You can try the following:

 3<sup>1</sup>&frasl;<sub>2</sub>years
Run codeHide result
+1
source

All Articles