What will be the mathematical symbol for representing the fraction?

I would like to show 2/3 (i.e. 2 divided by 3) in HTML format and I don't want to use / . What will be the correct character for formatting fractions / division using HTML?

+42
html
Dec 15 '10 at 11:02
source share
7 answers

Judging by your comments, it looks like you are specifically asking how to display fractions. In this case, many fractions are defined as HTML objects. For example, some of these objects:

 ½ ¼ ⅛ ⅔ ⅖ ¾ ⅜ 

Result:

& frac12; & Frac14; & Frac18; ? Frac23; & Frac25; ? Frac34; & Frac38;

Note that not all browsers support these named objects, but you can use their Unicode values ​​instead. If you want to be able to display a fraction, not just those that have entities, you can use the slash fraction, ⁄ (& frasl;). This character overlaps the pixels from the previous and next characters to make a very neat fraction. It is best used in combination with superscript and index numbers:

 <sup>39</sup>&frasl;<sub>40</sub> 

Result:

39 ? <sub> 40sub>

Additional literature:
http://changelog.ca/log/2008/07/01/writing_fractions_in_html

If your font supports it, you can also embed indexes and indexes directly into your HTML from an application such as charmap.exe. See Conrad Rudolph for a great answer for an example.

+131
Dec 15 '10 at 11:13
source share
β€” -

To generate the division sign Γ· , enter &divide; or &#247;

+48
Dec 15 '10 at 11:05
source share

Use Object &#247;

Γ·

ASCII HTML characters

+16
Dec 15 '10 at 11:04
source share

Take a look at this article: Writing Fractions in HTML

Since you want to see the denominator below the numerator, you can use the code:

 <sup>2</sup> &frasl; <sub>3</sub> 

What will look like:

2 & Frasl; <Sub> 3sub>

+12
Dec 15 '10 at 11:17
source share

By the way, you do not necessarily resort to HTML tags and HTML objects (perhaps the <sup> and <sub> arent tags are well suited for the task). You can also rely solely on Unicode:

Predefined vulgar fractions:

  • U + 00BC ΒΌ
  • U + 00BD Β½
  • U + 00BE ΒΎ
  • U + 2153 β…“
  • ...

And then the the crash (U + 2044, /) and the upper and lower indices at the positions U + 00B9, U + 00B2, U + 00B3 and starting with U + 2070. Using them, you can get arbitrary vulgar fractions:

⁴⁡ / ₂₃

All this was written as shown on the screen ( look at the source if you do not believe me!), No HTML code at all. However, not many fonts support all numeric forms, so the HTML variant may be more useful in practice.

+11
Dec 15 '10 at 16:06
source share

Since you prefer to display the numerator / denominator format, use &frasl; combined with HTML sup and sub

Example:

 <sup>4</sup> &frasl; <sub>9</sub> will give you 

4 & frasl; <Sub> 9Sub>

To be more secure, you can use the decimal option: &#8260;

Example:

 <sup>4</sup> &#8260; <sub>9</sub> will give you 

4/9

+9
Dec 15 '10 at 11:09
source share

You can use MathML to write more complex mathematical formulas and equations.

http://www.mozilla.org/projects/mathml/demo/basics.xhtml

+2
Dec 21 '10 at 15:32
source share



All Articles