Bootstrap simple Form display learning notes _javascript tips

Source: Internet
Author: User

Form layout

Vertical or Basic form

Basic form structure when bootstrap, the steps to create a basic form are as follows:

1, add role = "form" to the parent <form> element;
2, in order to get the best spacing, put the label and control in a div.form-group, Div placed under the parent form;
3. Add to all text elements <input>, <textarea> and <select>. Form-control

<! DOCTYPE html>
 
 

The Form-controlclass input and label are divided into two lines, and the blue border style is available when the focus is obtained.

Inline form

All the elements in the inline form are inline, and the labels are all side-by

1. Add classfrom-inline to <form> tags;
2. Each form need to be included in the Div.form-group,checkbox can be contained in the Div.checkbox,radio can be included in the Div.radio;
3. By default, the input, select, and textarea in Bootstrap have 100% widths, and you can set the width of the form control when you use inline forms;
4. Add sr-only to the label description to hide the label description.

<! DOCTYPE html>  

If you want to further study, you can click here to learn, and then attach 3 wonderful topics:

Bootstrap Learning Course

Bootstrap Practical Course

Bootstrap Plugin Usage Tutorial

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.