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

本文介绍了如何利用Bootstrap将网页划分为12列,并通过'col-md-x'类快速完成不同行的布局设置。此外,文章还展示了如何通过'row'类组织代码结构,确保页面布局不会超过12列,并提供了添加更多内边距的方法及实例。

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.

 

 

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

 

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

 

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

 

If you want to add more padding:

 

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

 

Result:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值