html - 如何对齐 checkbox.label 并水平输入
问题描述
如何修改下面发布的 html 代码以使所有复选框、标签和输入容器水平对齐。下面发布的代码为我提供了屏幕截图所示的对齐方式。
代码:
<div class="modal-body">
<form #form="ngForm" class="clr-form clr-form-horizontal" autocomplete="off">
<clr-toggle-wrapper>
<input type="checkbox" clrCheckbox (change)="toggleSelectPesticide1()" [(checked)]="pesticide1Selected"/>
<label >
{{ "SITE.GET_LIDAR" | translate }}
</label>
</clr-toggle-wrapper>
<clr-input-container>
<input
required
maxlength="25"
clrInput
type="text"
name="name2"
[(ngModel)]=iPesticidesDosesPasser.dose1
#name2="ngModel"
/>
</clr-input-container>
</form>
</div>
图片:
更新_1:
解决方案
我不确定,但你试试这个:
<div class="modal-body">
<form #form="ngForm" class="clr-form clr-form-horizontal" autocomplete="off" style="display: flex">
<clr-toggle-wrapper>
<input type="checkbox" clrCheckbox (change)="toggleSelectPesticide1()" [(checked)]="pesticide1Selected"/>
<label >
{{ "SITE.GET_LIDAR" | translate }}
</label>
</clr-toggle-wrapper>
<clr-input-container>
<input
required
maxlength="25"
clrInput
type="text"
name="name2"
[(ngModel)]=iPesticidesDosesPasser.dose1
#name2="ngModel"
/>
</clr-input-container>
</form>
</div>
推荐阅读
- python - 嵌套循环给出了多个问题
- html - flex容器中的img占用额外空间?
- python - “AttributeError: 'AnonymousUserMixin' 对象没有属性”删除并重新创建 SQLAlchemy 表后
- python - 如何将熊猫数据框转换为 Json?
- objective-c - 如何设置“其他链接器标志”以在 CMake 中包含 -ObjC?
- api - 如何提取或查找带有相关交易所后缀或前缀的 Trading Economics 平台股票代码列表
- flutter - 字符串列表到 StatefulWidget Flutter 列表
- swift - 领域 Swift 错误:当前不支持包含嵌入对象的循环
- r - 如何在 R Studio 中将多个条形图转换为百分比条形图
- ios - 如何使用插值字符串作为 Firebase Cloud Functions 和 Typescript 的主题名称