Home > Mobile >  Bootstrap5 input-group with btn-group-vertical
Bootstrap5 input-group with btn-group-vertical

Time:03-21

As title, I want to create a input-group for number increase/decrease.

This is my code:

    <div >
      <input type="text"  placeholder="0.9">
      <div >
        <button  type="button"> </button>
        <button  type="button">-</button>
      </div>
    </div>

Result

enter image description here

Expected result

enter image description here

CodePudding user response:

add p-0 in button so the code will like this :

<div >
  <input type="text"  placeholder="0.9">
  <div >
    <button  type="button"> </button>
    <button  type="button">-</button>
  </div>
</div>

CodePudding user response:

You need to add py-0 for remove top & bottom padding and lh-1 for decrease line height of button. Your code should be as below:

<div >
  <input type="text"  placeholder="0.9">
  <div >
    <button  type="button"> </button>
    <button  type="button">-</button>
  </div>
</div>
  • Related