
[英]Create text element inline with input checkbox list elements using javascript
[英]Inline Checkbox and Input Element in Bootstrap
我正在尝试使用 Bootstrap 内联输入和复选框
我的代码是:
<.-- Bootstrap-3.4:1 --> <link rel="stylesheet" href="https.//stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min:css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <;-- Body --> <form class="form " style=" width:250px; height:250px;"> <div class="form-group"> <input class="form-control " id="mawbNoCheck" type="checkbox" style="height: 34px;width:20px;"> <label style="width:100%;"> <input class="form-control" maxlength="50" id="txtMawb" placeholder="MAWB No" type="text" disabled /></label> </div> <div class="form-group"> <input class="form-control" id="collectionDatecheck" type="checkbox" style="height: 34px;width:20px;"> <label style="width:100%;"><input class="form-control date-picker" id="txtCollectionDate" maxlength="50" placeholder="Toplama Tarihi" type="text" disabled /></label> </div> <div class="form-group"> <input class="form-control " id="manifestDateCheck" type="checkbox" style="height: 34px;width:20px;"> <label style="width:100%;"><input class="form-control date-picker" id="txtManifestDate" maxlength="50" placeholder="Manifesto Tarihi" type="text" disabled /></label> </div> <div class="form-group "> <a class="btn btn-success">Güncelle</a> </div> </form>
但它看起来像这样:
只需设置 display:inline-flex;important;
<style>
form div.form-group{
display:inline-flex !important;
}
</style>
.form-group { position: relative; } label { position: absolute; top: 0; left: 35px; }
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <form class="form " style=" width:250px; height:250px;"> <div class="form-group"> <input class="form-control " id="mawbNoCheck" type="checkbox" style="height: 34px;width:20px;"> <label style="width:100%;"> <input class="form-control" maxlength="50" id="txtMawb" placeholder="MAWB No" type="text" disabled /></label> </div> <div class="form-group"> <input class="form-control" id="collectionDatecheck" type="checkbox" style="height: 34px;width:20px;"> <label style="width:100%;"><input class="form-control date-picker" id="txtCollectionDate" maxlength="50" placeholder="Toplama Tarihi" type="text" disabled /></label> </div> <div class="form-group">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.