How do I keep the input box in the middle?the page looks
This the link to the page oublished using github.
https://tahsinttalha.github.io/fcc-survey-form/
I have tried magin property to center the inout boxes. But in small screen, It’s not working properly. What can I do?
3
Answers
you can use
flex
to keep elements in the middle of box.like:add CSS to the
div
Try adding
box-sizing: border-box;
to the CSS-definition of your input:This way, the paddings and borders are calculated with all other measurements and not added after centering the element.
I suggest to use padding inside the main container, so all the div and block elements will take 100% of the width.
Just need to put width: 100% to all inputs.
I made a basic example :
I hope it will helps you 🙂