Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I express fractions like 15/16ths in HTML?

Tags:

html

I know there are HTML entities for 1/2, 1/4, and 3/4, but are there others? Like 1/3 or 1/8? Is there a good way to encode arbitrary fractions?

like image 554
raldi Avatar asked Oct 06 '08 06:10

raldi


People also ask

How do you represent fractions in HTML?

The HTML5 MathML <mfrac> tag is an inbuilt element in HTML5. It is use to add fraction symbol between two digits or equations.


2 Answers

how about 1516? (<sup>15</sup>&frasl;<sub>16</sub>)

like image 93
Henrik Paul Avatar answered Oct 08 '22 11:10

Henrik Paul


1/2 → &#189; or &frac12; 1/4 → &#188; or &frac14; 3/4 → &#190; or &frac34; 1/8 → &#8539; or &frac18; 3/8 → &#8540; or &frac38; 5/8 → &#8541; or &frac58; 7/8 → &#8542; or &frac78; 1/3 → &#8531; 2/3 → &#8532; 1/5 → &#8533; 2/5 → &#8534; 3/5 → &#8535; 4/5 → &#8536; 1/6 → &#8537; 5/6 → &#8538; 

...but you could also encode them as decimals: 15/16 = 0.9375 ;)

like image 29
scronide Avatar answered Oct 08 '22 10:10

scronide