需求
使 html 代码中的回车换行生效
实现
// For line break \n:
white-space: pre-line;
// For line break \n and tabs \t:
white-space: pre-wrap;
如何使用 CSS 使 HTML 代码中的回车换行生效。介绍了 `white-space: pre-line;` 和 `white-space: pre-wrap;` 属性。
使 html 代码中的回车换行生效
// For line break \n:
white-space: pre-line;
// For line break \n and tabs \t:
white-space: pre-wrap;