gpt4 book ai didi

css - ionic 标签未正确与其组对齐

转载 作者:行者123 更新时间:2023-11-28 14:20:08 25 4
gpt4 key购买 nike

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>

跨界

    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;
}

预期输出 enter image description here

我的结果 enter image description here

最佳答案

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

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

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

关于css - ionic 标签未正确与其组对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55295794/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com