![](/img/trans.png)
[英]How can I add line break to html text without using any html tag
[英]how can I use line break without any tag in html?
我想使用ajax在我的react代碼中返回一些結果,現在我應該在第二頁中使用換行符並返回結果,但是我不能使用<br/>
因為我的結果顯示了如下標記: hi br/ hi
。 如何在沒有任何html標記的情況下插入換行符? 我的ajax代碼:
$.ajax({
'async': false,
'type': "POST",
'global': false,
'dataType': 'html',
'url': "barRules.bc",
'data': { 'id': JSON.stringify(id) },
'success':(response)=>{
tmp = response;
}
});
我的第二頁:“ @Field:br / @value /”
使用white-space
css屬性並將其設置為pre-line
以便在html中保留新行。
.keep-new-line{
white-space: pre-line;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.