How do I style numbers?

后端 未结 2 630
粉色の甜心
粉色の甜心 2021-01-21 08:33

I am trying to change the styling of numbers.

  • I want to add some space between every 3 digits.
  • I will know exactly where the numbers will be located in t
2条回答
  •  日久生厌
    2021-01-21 09:02

    I suggest to use display:flex so that the "sep" character is in auto-determined font-size.

    The idea is that turn

    1000

    into

    1000

    by js.

    Then, add "sep" character visually by css generated content. span:nth-last-of-type(3n) { content:; ..}. This way, the (can be any character actually) will have same font-size as number text.

    demo

提交回复
热议问题