javascript - 文本没有显示它应该如何在 html 中

标签 javascript jquery html css

我有一段文字看起来像这样:

<p> We recently reduced the number of savings accounts we offer. I welcomed this because I think
 members find it confusing to look through tables of lots of slightly different accounts, all 
with advantages and disadvantages. I think it affects their trust in us. But I don’t understand 
why we haven’t applied this to children’s accounts of all things. Since children don’t pay tax, 
why do they need an ISA as well as a children’s savings account? Children (and their parents) 
are the last people we want to confuse as they could be customers for life. And why is our 
children’s savings account called the ‘Smart Limited Access’? It doesn’t strike me as being very 
self-explanatory or child friendly. How about just ‘Nationwide Young Saver Account’?

I’d be grateful if you could clear this up for me.

Best regards,

Vanessa</p>

但是,当它被放入 html 时,它会忽略此布局并使其只有一行。我怎样才能保留它的原始文本

最佳答案

使用 <pre>那不是<p>标签以保持格式相同。

<pre>Now
Line endings
Are conserved !</pre>

关于javascript - 文本没有显示它应该如何在 html 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26219855/

相关文章:

javascript - jQuery - 将选择的值设置为其选项之一

jquery - 将 HTMl5 应用程序移动到 ipad 时要注意什么?

JavaScript 模块模式 - 使用 "return this"怎么样?

javascript - 动态 JQuery 移动导航

javascript - WebRTC:如何计算RTC Peer Connection的用户带宽/网络延迟

javascript - 使用 jQuery 在悬停时更改文本

html - 如何将我的列表居中?

javascript - 如何使用 jQuery 选择具有相似属性的元素?

javascript - Visual Studio Code 调试控制台中的 Node.js readline

javascript - 删除 Angular 图表中的网格线。 Chart.js