Bootstrap grid system

Source: Internet
Author: User

1. Working principle

1), the data row (. Row) must be included in the container (. Container) to give it the appropriate alignment and padding (padding).

The code is as follows:

<class= "container">        <class = "Row" ></ Div > </ Div >

2), a column (. column) can be added to a row (. row), but the sum of the columns cannot exceed the total number of columns in the split, such as 12.

The code is as follows:

  <Divclass= "Container">        <Divclass= "Row">            <Divclass= "Col-md-4"></Div>            <Divclass= "Col-md-8"></Div>        </Div>  </Div>

3), the specific content should be placed within the column container (columns), and only the columns (column) can be used as a direct child element of the row container (. Row).

4), create the spacing between columns by setting the padding (padding). The effect of the padding (padding) is then offset by setting a negative margin (margin) for the first column and the last column.

2. Basic usage

3. Column offset (col-md-offset-*)

Where the * number represents the number of column combinations to offset. You add "col-md-offset-4" on the column element to indicate that the column moves the width of the 4 columns to the right.

4. Column sorting (col-md-push-* and col-md-pull-* (where the asterisk represents the number of column combinations moved))

5. Nesting of columns

The code is as follows:

<Divclass= "Container">    <Divclass= "Row">        <Divclass= "Col-md-8">I have a grid nested inside.<Divclass= "Row">            <Divclass= "Col-md-6">Col-md-6</Div>            <Divclass= "Col-md-6">Col-md-6</Div>          </Div>        </Div>    <Divclass= "Col-md-4">Col-md-4</Div>    </Div>    <Divclass= "Row">        <Divclass= "Col-md-4">. col-md-4</Div>    <Divclass= "Col-md-8">I have a grid nested inside.<Divclass= "Row">          <Divclass= "Col-md-4">Col-md-4</Div>          <Divclass= "Col-md-4">Col-md-4</Div>          <Divclass= "Col-md-4">Col-md-4</Div>        </Div>    </Div>    </Div></Div>

Bootstrap grid system

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.