Home > Software engineering >  Bootstrap 4 row align class center class is not working
Bootstrap 4 row align class center class is not working

Time:06-18

<div > 
<input type="checkbox"  checked>Remember Me
</div>
                    
<div >
<input type="submit" value="Login" >
</div>

It should be showed in the middle instead. Somehow it doesn't work.

CodePudding user response:

align-items-center works for flexbox. You need to make your div a flex-box first and also add justify-content-center to align child items center on the x axis.

<div > 
<input type="checkbox"  checked>Remember Me
</div>
                
<div >
<input type="submit" value="Login" >
</div>

CodePudding user response:

I think you are centering the elements without assigning display:flex to the parent. So you should add d-flex and justify-content-center classes beside row class.

But you can just add "text-center" class as input element is inline

  • Related