I would like to shown 2/3
(i.e. 2 divided by 3) in a HTML format and I don't want to use /
. What would be the right symbol to format fractions/division using HTML?
Judging by your comments, it looks like you're specifically asking how to display fractions. If that's the case, many fractions are defined as HTML entities. As an example, a few of those entities are:
½ ¼ ⅛ ⅔ ⅖ ¾ ⅜
Result:
½ ¼ ⅛ ⅔ ⅖ ¾ ⅜
Note that not all browsers support those named entities, but you could use their Unicode values instead. If you want to be able to display any fraction and not just the ones that have entities, you can use the fraction slash entity, ⁄
( ⁄ ). This character overlaps pixels from the preceding and following characters to make a very neat fraction. It's best used when combined with superscript and subscript numbers:
<sup>39</sup>⁄<sub>40</sub>
Result:
39⁄40
Further reading:
http://changelog.ca/log/2008/07/01/writing_fractions_in_html
If the font you're using supports it, you may also be able to paste the subscript and superscript numbers directly into your HTML from an application like charmap.exe. See Konrad Rudolph's excellent answer for an example.
To generate the division sign ÷
, type ÷
or ÷
Use the entity ÷
÷
HTML ASCII Characters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With