数据库里的\n怎么变成换行,textarea提交的数据里有\n,读取的时候html不识别,怎么变成换行

只要在结果所在的 div 的 css 设置:

white-space: pre-line;

然后页面就能成功识别 '\n' 并整齐的显示结果了。

参考:https://www.jianshu.com/p/a580568e0055

猜你喜欢

转载自blog.csdn.net/cplvfx/article/details/84639145