如何使Bootstrap列都具有相同的高度?

本文介绍了如何在Bootstrap 3和4中创建等高列,包括使用Flexbox、负边距、表格布局和jQuery插件等解决方案,确保在响应式设计中保持列的高度一致。
摘要由CSDN通过智能技术生成

本文翻译自:How can I make Bootstrap columns all the same height?

I'm using Bootstrap. 我正在使用Bootstrap。 How can I make three columns all the same height? 如何使三根柱子的高度相同?

Here is a screenshot of the problem. 这是问题的屏幕截图。 I would like the blue and red columns to be the same height as the yellow column. 我希望蓝色和红色列与黄色列的高度相同。

三个引导程序列,中间列比其他两列长

Here is the code: 这是代码:

 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <div class="container-fluid"> <div class="row"> <div class="col-xs-4 panel" style="background-color: red"> some content </div> <div class="col-xs-4 panel" style="background-color: yellow"> catz <img width="100" height="100" src="https://lorempixel.com/100/100/cats/"> </div> <div class="col-xs-4 panel" style="background-color: blue"> some more content </div> </div> </div> 


#1楼

参考:https://stackoom.com/question/1Kdlw/如何使Bootstrap列都具有相同的高度


#2楼

Solution 4 using Bootstrap 4 使用Bootstrap 4的解决方案4

Bootstrap 4 uses Flexbox so there's need for extra CSS. Bootstrap 4使用Flexbox,因此需要额外的CSS。

Demo 演示版

<div class="container">
   
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值