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

本文介绍如何使用Bootstrap快速构建网页布局,通过将页面划分为12列的网格系统,实现响应式设计。文中详细展示了如何利用'col-md-x'类创建不同列数的内容区块,并通过'row'类组织代码结构。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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:

转载于:https://www.cnblogs.com/Answer1215/p/4294314.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值