Class="form-control" What does that do?

Hi all. I’m not clear what the form control class is, or what it does. Does anyone have the ability to clarify that for me?

It’s a class defined by Bootstrap.

All textual <input>, <textarea>, and <select> elements with .form-control are set to width: 100%; by default.


So essentially what it’s doing is lengthening the text-input area to cover the width of the screen that it’s viewed on, or atleast the window that the form is in. Is that right?

Not just the width of the screen it’s in, but the width of the container it’s in. Aside from setting it’s width, .form-control also tweaks the <input>'s appearance (including the borders, padding, colors, etc.).


I certainly appreciate your help.

Hi @newthings!

Welcome to the forum!

This thread has not been active for four years. Please try to participate in newer topics. Thank you.