<br> 未在 Firefox 的 JSP 中呈现

<br> not rendered in jsp in firefox

本文关键字:JSP 未在 br Firefox      更新时间:2023-09-26

我有一篇很长的文字,有几个段落。为了在 jsp 页面中显示它,我用 <br> 替换了换行符。现在一切都在Chrome中正确显示,但在Firefox中没有。

在 Firefox 中,只有前几段用 <br> 正确呈现,但后面的段落放在一起,好像那里没有<br>,尽管我查看了源代码。

有人对这个问题有想法吗?

顺便说一句,文本在 Chrome 中是正确的,但如果我滚动它,它的反应会非常慢。

唯一完美的浏览器是 eclipse 内置浏览器,完全没有问题。

与其将

"br"添加到您想要段落间隙的 JS 输出代码中,不如为每个"p"标签添加一个类并将"margin-bottom: 10px;"应用于该类?

简单示例

.JS

document.write("<p class='paragraph'>This is the paragraph</p>");
document.write("<p class='paragraph'>This is the paragraph</p>");
document.write("<p class='paragraph'>This is the paragraph</p>");

.CSS

.paragraph {
margin-bottom: 10px;
}