Home > Back-end >  Shrinking width of form
Shrinking width of form

Time:10-11

I want my form to go in the top right hand corner. The form contains a label and input textbox. I have been trying to position the textbox and associated label using margin-left. I gradually started to realise though that the form was much bigger than met the eye.

This gives me a width of 1328px -

<form  ;method='GET'>
 
Test to see form size

</form>

I tried this

<form  style="width: 300px" method='GET'>
 
Test to see form size

</form>

enter image description here But you can tell the overall form width is still 1328px.

How can I reduce the width of the form so it is the same size as the label and input box.

CodePudding user response:

You can select the form element and add an absolute position to it.

form{
  position: absolute;
  top: 0;
  right: 0;
}

Just to see if it moves to the top right corner.

  • Related