[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

时间:2023-03-08 23:22:23
[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

Usually when desgin a web page, we think building the page in grid.

Bootstrap can help us to do that.

It divides the page into 12 cols. In the picture, there are three rows, on the top is header (it takes 12 cols), in the middle there is two cols, in the bottom, there are three cols.

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

You can finish this work quickly by using 'col-md-x' class: it should sum up to 12 for each row.

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

To organize the code structure better, you can but add 'row' class:

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

If one row exceeds 12 cols, the page layout would broken.

If you want to add more padding:

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

You can use 'col-md-offest-x' class:

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'

Result:

[Bootstrap] 2. class 'row' & 'col-md-x' & 'col-md-offset-x'