बूटस्ट्रैप सीएसएस प्रपत्र संदर्भ
बूटस्ट्रैप की डिफ़ॉल्ट सेटिंग्स
व्यक्तिगत प्रपत्र नियंत्रण स्वचालित रूप से बूटस्ट्रैप के साथ कुछ वैश्विक स्टाइल प्राप्त करते हैं।
सभी पाठ्य <इनपुट>, <textarea>, और <select> वर्ग के साथ तत्व = "फॉर्म-नियंत्रण" चौड़ाई पर सेट हैं: 100%; डिफ़ॉल्ट रूप से।
तीनों प्रपत्र लेआउट के लिए मानक नियम:
- लेबल और प्रपत्र नियंत्रणों को इसमें लपेटें
<div class="form-group">
(इष्टतम रिक्ति के लिए आवश्यक) .form-control
सभी पाठ्य<input>
,<textarea>
, और<select>
तत्वों में वर्ग जोड़ें
निम्न उदाहरण दो इनपुट फ़ील्ड, एक चेकबॉक्स और सबमिट बटन के साथ एक साधारण बूटस्ट्रैप फॉर्म बनाता है:
बूटस्ट्रैप फॉर्म उदाहरण
<form>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd">
</div>
<div class="checkbox">
<label><input type="checkbox"> Remember me</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
फॉर्म क्लासेस
Class | Description | Example |
---|---|---|
.form-inline | Makes a <form> left-aligned with inline-block controls (This only applies to forms within viewports that are at least 768px wide) | |
.form-horizontal | Aligns labels and groups of form controls in a horizontal layout | |
.form-control | Used on input, textarea, and select elements to span the entire width of the page and make them responsive | |
.form-control-feedback | Form validation class | |
.form-control-static | Adds plain text next to a form label within a horizontal form | |
.form-group | Container for form input and label |
इनपुट क्लासेस
Class | Description | Example |
---|---|---|
.input-group | Container to enhance an input by adding an icon, text or a button in front or behind it as a "help text" | |
.input-group-lg | Large input group | |
.input-group-sm | Small input group | |
.input-group-addon | Together with the .input-group class, this class makes it possible to add an icon or help text next to the input field | |
.input-group-btn | Together with the .input-group class, this class attaches a button next to an input. Often used as a search bar | |
.input-lg | Large input field | |
.input-sm | Small input field |