您的位置: 首页 > 文章 > 在html页面填入字符串,\n换行不起作用,怎么办? 在html页面填入字符串,\n换行不起作用,怎么办? 分类: 文章 • 2024-12-10 10:56:16 CSS white-space 属性 在white-space属性中,有上图几个值可供选择,我们可以在DOM元素中使用white-space: pre-line; 这样在html页面填入字符串,\n换行就起作用了。