【问题标题】:add an empty line between 2 spans在 2 个跨度之间添加一个空行
【发布时间】:2021-06-21 12:01:14
【问题描述】:

我正在尝试在两个文本跨度之间添加一个空行

    <span> The models have random values that I dont understand and it is not sufficenit but whatever </span>
    {'\n'}
    <span>Lots of text here </span>

{'\n'} 似乎不起作用。我还能尝试什么?

【问题讨论】:

  • 你也可以使用div并提供CSS,比如margin。

标签: javascript html css reactjs typescript


【解决方案1】:

正如阿里所说,您可以使用&lt;br&gt;

或者您可以将它们放入&lt;p&gt; 标签中,因为它们是文本... span 通常不用于大量文本

代码应该是这样的

<p> The models have random values that I dont understand and it is not sufficenit but whatever </p>
    
<p>Lots of text here </p>

【讨论】:

    【解决方案2】:

    为此使用&lt;br/&gt;标签

        <span> The models have random values that I dont understand and it is not 
           sufficenit but whatever </span>
        <br />
        <span>Lots of text here </span>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-22
      • 1970-01-01
      • 1970-01-01
      • 2015-08-23
      • 1970-01-01
      • 1970-01-01
      • 2015-11-19
      • 1970-01-01
      相关资源
      最近更新 更多