.form-control
can only be used on certain HTML elements, and there are further restrictions about which type
s of <input>
elements it can be used on.
.form-control
cannot be used on non-textual <input>
s, such as those whose type
is: file
, checkbox
, radio
, range
, button
When used on an <input>
element, .form-control
can only be used on <input>
s whose type
is text-like, namely:
<input type="text">
<input type="password">
<input type="search">
<input type="number">
<input type="email">
<input type="url">
<input type="tel">
<input type="datetime-local">
, <input type="date">
, <input type="month">
, <input type="week">
, <input type="time">
<input type="color">
Contrastingly, .form-control
cannot be used on non-textual <input>
s, namely:
<input type="file">
<input type="range">
<input type="image">
<input type="button">
, <input type="submit">
, <input type="submit">
.form-control
, use the .btn
(and possibly .btn-block
) classes for styling button-ish <input>
s.<input type="checkbox">
, <input type="radio">
.form-control
, use the .checkbox
or .radio
classes (which DON'T go on the <input>
s themselves) for styling these.<input type="hidden">
.form-control
should only be used on <input>
s, <textarea>
s, and <select>
s.
The .form-control
class cannot be used on arbitrary HTML elements. It can only be used on <input>
s, <textarea>
s, and <select>
s.
Wrong:
<button class="form-control">None of</button> <div class="form-control">these</div> <span class="form-control">make any</span> <a class="form-control">sense!</a>
Right:
<input type="text" class="form-control" value="Text input" /> <textarea class="form-control">Text area</textarea> <select class="form-control"> <option>Option 1</option> <option>Option 2</option> ... </select>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4