1

I have made an input form and one of the inputs is an amount, everything works however the field seems to take the width of my entire browser, anyone know why?

<input type="text" class="form-control" placeholder="2.00" width="50px" name="amount"><br>

2 Answers 2

5
<input type="text" class="form-control" placeholder="2.00" style="width:50px" name="amount"><br>

Use style ;)

Sign up to request clarification or add additional context in comments.

4 Comments

This works, however it is no longer center aligned along with everything else in my <div class="row text-center"> Any ideas?
could you post a bit of the content within the <div class="row text-center"> div.
Ignore the above, I see what you mean. Gimme a sec
Nevermind, I have fixed the alignment issue by using '<div align="center">' instead.
1

If you want to make the whole form a certain length (50%) Use:

  <form class="form-horizontal" style="width:50%;">
     //your form
  </form>

or:

 <div style="width:50%;">
    <form class="form-horizontal">
       //your form
    </form>
 </div>

or:

   <input type="text" class="form-control" placeholder="2.00" width="50px" name="amount" style="width:50%;"><br>

I used the second option. example

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.