Webpage character spacing problem

Key words

  •   Space escape character
  • letter-spacing
  • word-spacing The space between consecutive characters separated by spaces and the next consecutive character

example

The existing statistics are described as follows:

<span> Total:50 name:apple price:20.5 </span>

<span>Total: 50 Articles Name: Apple Unit Price: 20.5 Yuan</span>

Without considering the quotation of multiple tags , we lazily use a span tag to form the effect of three columns

problem

  • HTML does not support parsing of spaces
  • &nbsp;In the template language (such as: react/vue, etc.), the content will not be escaped, that is, it will be output as it is

solution

  • word-spacing: 对连续的字符以空格分割,进行间距修饰,中文字符空格隔开同样有效

effect

Total:50 name:apple price:20.5
Total: 50 items Name: Apple Unit price: 20.5 yuan

Guess you like

Origin blog.csdn.net/jianleking/article/details/86678627