Skip to content

HTML 回车换行与 CSS

Published: at 09:40 AMSuggest Changes

需求

使 html 代码中的回车换行生效

实现

// For line break \n:
white-space: pre-line;
// For line break \n and tabs \t:
white-space: pre-wrap;

参考文章

Line break in HTML with ‘\n’


Previous Post
CSS 实现 1px 高清边框
Next Post
JS 数组字符串转换为对象