【问题标题】:Align div inside ion-col to bottom of column将 ion-col 内的 div 对齐到列的底部
【发布时间】:2018-08-17 00:10:46
【问题描述】:

我有一列里面有多个divs。如何将最后一个 div 对齐到列的底部?

示例代码:

<!-- language: lang-html -->
  <ion-grid>
    <ion-row>
      <ion-col>
        <div> some text at the top </div>
        <div> more text at the top </div>
        <div> text at the bottom </div> <!-- I want this to be at the bottom of the column-->
      </ion-col>
    </ion-row>
  </ion-grid>

【问题讨论】:

  • 最后一个 div 已经在列的底部,它会自动垂直放置 div。
  • @theriddle2 列后有空格,直到下一行。我希望最后一个 div 与列的底部对齐
  • 你的意思是填充吗? ion-col 所有边都有 5px 的填充,如果你的意思是 ion-col { padding: 0px } 会消除它
  • @theriddle2 不,抱歉,我解释得不好。我在离子行中有 2 列。其中一列比这一列长,因此会产生额外的空间。

标签: ionic-framework ionic2 ionic3


【解决方案1】:

我没有很好地解释我的问题。 我在同一个ion-row 中有两列高度不同,这在较短的列上创造了额外的空间。

我通过将所需的底部 div 放在单独的离子行中解决了我的问题。

【讨论】:

    猜你喜欢
    • 2018-09-06
    • 2012-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多