【发布时间】:2015-02-26 08:03:45
【问题描述】:
我有一个消息框,其中有一个带有一些文本的 div。 我正在传递“凌晨 1 点 khushbu/n 新年快乐”。它不考虑 /n 作为命令。 ..它把它当作文本。 如果我写的话,我想要那个:
"hello
I
am
"
它应该打印在下一行。 也用过。 我正在使用这种风格:
<div id="Stage_Scrolls_MessageBox_message_box_Text"
class="Stage_Scrolls_MessageBox_message_box_Text_id"
style="position: absolute;
margin: 0px;
left: 12.61%;
top: 23.18%;
width: 165px;
height: 157px;
right: auto;
bottom: auto;
font-family: abel;
font-size: 21px;
font-weight: 400;
color: rgb(166, 33, 36);
text-decoration: none;
font-style: normal;
word-wrap: break-word;
text-align: center;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-transform: translateZ(0px);
line-height: 25px;
letter-spacing: 0px;">
During this Season may the joy and love of </br> Christmas be yours.
</div>
【问题讨论】:
-
改用
<br />标签。 -
我的文本没有接受命令.../n 或 。在控制台上,它在下一行显示我的文本,但在视图中..它没有在下一行显示我跨度>
-
@chipChocolate.py - 谢谢。
-
你可以尝试使用前置标签jsfiddle.net/wufx69pb/2
-
看起来您的模板框架正在对您的 html 进行编码?或者您正在那里的文本上运行某种 html 实体编码功能。这可能就是你的中断标签不起作用的原因。