【问题标题】:Single json key have to display multiple strings with line breaks单个 json 键必须显示多个带换行符的字符串
【发布时间】:2015-04-05 02:45:32
【问题描述】:

我有一个包含多行的 json 键。现在这些值必须在 HTML 中显示,并带有换行符。但是换行符不会到来。

这是我的 json 密钥。我希望规则 1、2、3 以适当的中断显示在 HTML 中。 "componentValue":" 1)Please ensure that password is between 6 and 15 characters in length,2)Password should have atleast one digit,3)Password should contain an upper case. ",

【问题讨论】:

    标签: html json key


    【解决方案1】:

    将此 CSS 规则添加到您将带有新行的文本放入的容器中:

    .container {
        white-space: pre;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-29
      • 2013-05-25
      相关资源
      最近更新 更多