沒有名爲(或數字)字符對於代表3/3的字符的引用,因爲根本沒有這樣的字符。
理論上,可以在數字之間使用FRACTION SLASH U + 2044「/」字符(在HTML中表示爲),以表明呈現例程將組合作爲印刷部分。在實踐中,只有一些排版程序可以做到這一點,並且網頁瀏覽器遠沒有來臨。
試圖使用HTML標記和/或CSS來構建看起來像印刷部分的東西(在外觀上相當於½)往往會產生混亂的結果,包括不均勻的行間距。
實際的選擇是使用普通的符號,如2/2。但是如果你想要一個印刷分數的東西,你可以使用MathML MathJax。更確切地說,MathML中的mfrac元素的屬性爲bevelled="true"。示例代碼:
Fractions with MathJax and MathMLHere we have the common fraction ½, then
a simulation with HTML and CSS:
1⁄2.
Note that this tends to create uneven line spacing.
There are some cures to that, but let us see how MathML works:
1
2
.
Some text here to demonstrate that line spacing has not
been disturbed here.
樣品渲染: