如何在 select2 旁边设置按钮位置?
How to make button position beside select2?
How to make button position beside select2?,在我的例子中,我希望在同一行和select2旁边的右侧有一个'Test'按钮,我尝试了以下方法:
<div class="card-body">
<div class="row">
<div class="col-lg-3">
<label for="hsm_new_ticket">New ticket</label>
<select class="form-select select2-single" id="hsm_new_ticket"></select>
</div>
<div class="col-lg-1">
<button class="btn btn-block btn-secondary btn-sm"
id="btnTest_hsm_new_ticket" type="button"
onclick="alert('I m here')">
Test
</button>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-3" style="display:flex; justify-content:center; align-items: flex-end;">
<div class="col-lg-11">
<label for="hsm_new_ticket">New ticket</label>
<select class="form-select select2-single" id="hsm_new_ticket"></select>
</div>
</div>
<div class="col-lg-1" style="display:flex; justify-content:center; align-items: flex-end;">
<label for="hsm_new_ticket"></label>
<button class="btn btn-block btn-secondary btn-sm" id="btnTest_hsm_new_ticket" type="button" onclick="alert('I m here')">
Test
</button>
</div>
</div>
</div>
How to make button position beside select2?,在我的例子中,我希望在同一行和select2旁边的右侧有一个'Test'按钮,我尝试了以下方法:
<div class="card-body">
<div class="row">
<div class="col-lg-3">
<label for="hsm_new_ticket">New ticket</label>
<select class="form-select select2-single" id="hsm_new_ticket"></select>
</div>
<div class="col-lg-1">
<button class="btn btn-block btn-secondary btn-sm"
id="btnTest_hsm_new_ticket" type="button"
onclick="alert('I m here')">
Test
</button>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-3" style="display:flex; justify-content:center; align-items: flex-end;">
<div class="col-lg-11">
<label for="hsm_new_ticket">New ticket</label>
<select class="form-select select2-single" id="hsm_new_ticket"></select>
</div>
</div>
<div class="col-lg-1" style="display:flex; justify-content:center; align-items: flex-end;">
<label for="hsm_new_ticket"></label>
<button class="btn btn-block btn-secondary btn-sm" id="btnTest_hsm_new_ticket" type="button" onclick="alert('I m here')">
Test
</button>
</div>
</div>
</div>