Home > Back-end >  Trouble while applying padding in form element
Trouble while applying padding in form element

Time:12-17

Image of code I am applying styling on form element.

CodePudding user response:

The content should really be in a div tag, also if you want the grey background to be smaller you should use a margin:

form {
       margin: 20px 20px 20px 20px;
     }

This will apply margin in the following way: Top, Right, Bottom, Left

CodePudding user response:

Make sure you're using box-sizing: border-box; and your body or any other container class is having max-width:100%;

*, ::after, ::before {
    box-sizing: border-box;
}
  • Related