【问题标题】:ion-label not correctly aligned with its groupion-label 未与其组正确对齐
【发布时间】:2019-08-13 05:09:17
【问题描述】:

div 标签中的[bug] 标签跳转到其顶部的另一组项目。

下面是代码

  <div id="group">
    <div class="col" lines="none">
      <ion-label position="stacked">EXPIRY DATE</ion-label>
      <ion-input placeholder="MM/YY"></ion-input>
    </div>
    <div class="col" lines="none" id="div-security">
      <ion-label position="stacked">SECURITY CODE</ion-label>
      <ion-input placeholder="999"></ion-input>
    </div>
  </div>

  <!-- Inputs with labels that is messing up-->
  <div class="grouping" lines="none">
    <ion-label  display="block">ZIP/POSTAL CODE</ion-label>
    <ion-input placeholder="60001"></ion-input>
  </div>

scss

    ion-card {

  .col {
    margin-right: 6px;
    float: left;
    width: 171px;

    margin-top: 24px;
    margin-bottom: 24px;
    background: transparent;
    border: 1px #000;
    border-bottom-style: dotted;
  }
  .grouping {
    margin-top: 24px;
    background: transparent;
    border: 1px #000;
    border-bottom-style: dotted;
  }
ion-label {
  height: 18px;
  bottom: 49px;
  margin-bottom: 16px;
  font-family: Open Sans;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #212121;
}

预期输出

我的结果

【问题讨论】:

    标签: css ionic-framework sass


    【解决方案1】:

    尝试将Display:inline-block; 添加到您的分组类中,如下所示:

     .grouping {
        display: inline-block;
        margin-top: 24px;
        background: transparent;
        border: 1px #000;
        width:100%;
        border-bottom-style: dotted;
      }
    

    为我工作,您可以添加width:100%(或添加拉伸的任何内容)。 Div 默认显示导致您的问题的块。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-22
      • 1970-01-01
      • 2018-12-25
      • 2017-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多