【问题标题】:To place text under each other将文本置于彼此之下
【发布时间】:2020-12-07 07:18:24
【问题描述】:

如何将文字放在一起? 现在我明白了:

但我想获得相对于彼此对齐的文本

<Col span='8' style={{textJustify: 'inter-word'}}>
          <p style={{textAlign: 'justify'}}>Aug 20</p>
          <p style={{textAlign: 'justify '}}>Jul 20</p>
        </Col>

【问题讨论】:

  • p 在其样式中有一些默认边距。
  • 你有没有试过给第二个p留余地,如果你想让它相对于第一个p

标签: javascript html css alignment col


【解决方案1】:

我会将所有内容都包装在 1 个 div 中,然后给该 div 一个特定的宽度和高度

【讨论】:

    【解决方案2】:

    要对齐内联项目,试试这个

    <Col span='8' style={{textJustify: 'inter-word', display:"flex"}}>
      <p style={{textAlign: 'justify'}}>Aug 20</p>
      <p style={{textAlign: 'justify '}}>Jul 20</p>
    </Col>
    

    <Col span='8' style={{textJustify: 'inter-word'}}>
      <p style={{textAlign: 'justify', display:'inline'}}>Aug 20</p>
      <p style={{textAlign: 'justify ', display:'inline'}}>Jul 20</p>
    </Col>
    

    【讨论】:

      猜你喜欢
      • 2012-02-15
      • 1970-01-01
      • 1970-01-01
      • 2014-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-25
      • 1970-01-01
      相关资源
      最近更新 更多