使用 CSS 控制文本的流向和格式
javascriptweb developmentfront end scripts
white-space 属性用于控制文本的流向和格式。
示例
您可以尝试运行以下代码来实现 white-space 属性来控制文本的流向:
<html> <head> </head> <body> <p style = "white-space:pre;"> This text has a line break and the white-space pre setting tells the browser to honor it just like the HTML pre tag.</p> </body> </html>