Home > Net >  Bootstrap: move text to the side of Checkbox
Bootstrap: move text to the side of Checkbox

Time:12-29

I'm trying to get the "Default checkbox" to be at the side of the checkbox

checkbox

what i have so far

<div >
     <label for="Desc" >Default Checkbox

      </label>
     <div >
          <input type="checkbox" readonly id="defcheck" name="defcheck" 
       data-toggle="tooltip" data-placement="right" size="2"> 
         <br />
                                    
      </div>
</div>

Tried to just move the label tag below the input type but that did not work

CodePudding user response:

Use below code.

<div >
     <div  style="display: flex;">
          <input type="checkbox" readonly="" id="defcheck" name="defcheck"  data-toggle="tooltip" data-placement="right" size="2" style="width: auto;"> 
          <label for="Desc"  style="padding: 12px;">Default Checkbox</label>
      </div>
</div>

CodePudding user response:

<div >
     <div >
            <label for="Desc" >Default Checkbox</label>
          <input type="checkbox" readonly id="defcheck" name="defcheck" 
   data-toggle="tooltip" data-placement="right" size="2"> 
         <br />
      </div>
</div>

OR

<div >
     <div >
          <input type="checkbox" readonly id="defcheck" name="defcheck" 
   data-toggle="tooltip" data-placement="right" size="2"> 
    <label for="Desc" >Default Checkbox</label>

      </div>
</div>
  • Related