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

前端 未结 7 1478
慢半拍i
慢半拍i 2021-02-05 04:49

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?

7条回答
  •  既然无缘
    2021-02-05 05:16

    1/2 → ½ or ½
    1/4 → ¼ or ¼
    3/4 → ¾ or ¾
    1/8 → ⅛ or ⅛
    3/8 → ⅜ or ⅜
    5/8 → ⅝ or ⅝
    7/8 → ⅞ or ⅞
    1/3 → ⅓
    2/3 → ⅔
    1/5 → ⅕
    2/5 → ⅖
    3/5 → ⅗
    4/5 → ⅘
    1/6 → ⅙
    5/6 → ⅚
    

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

提交回复
热议问题