CSS 中 white-space 属性的使用
javascriptweb developmentfront end scripts
white-space 属性用于控制文本的流向和格式。
示例
您可以尝试运行以下代码来实现 white-space 属性:
<html> <head> </head> <body> <p style = "white-space:pre;"> 此文本有换行符,white-space 预设告诉浏览器要遵守 它就像 HTML pre 标签一样。</p> </body> </html>