如何使Bootstrap5列变为所有类似的高度?
我正在使用Bootstrap5。但是,我只想在这两列中构成类似的高度。我该怎么做? 这是代码:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="container">
<div class="row">
<div style="background-color:LightGray" class="container-1 col-xs-6" >
Cake
<img src="https://www.mybakingaddiction.com/wp-content/uploads/2011/10/lr-0953.jpg" alt="Cake"/>
<div style="background-color:Gray" class="container-2 col-xs-6">
Content
</div>
</div>
</div>
</div>
I'm using Bootstrap5. However, I'd just like to make a similar height of these two columns. How can I do that?
Here's the Code:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="container">
<div class="row">
<div style="background-color:LightGray" class="container-1 col-xs-6" >
Cake
<img src="https://www.mybakingaddiction.com/wp-content/uploads/2011/10/lr-0953.jpg" alt="Cake"/>
<div style="background-color:Gray" class="container-2 col-xs-6">
Content
</div>
</div>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许这会有所帮助
Maybe this can help
Col-XS-6在Bootstrap5中不起作用,因此您可以使用col-6而不是col-xs-6和Div关闭,并且不正确使用
col-xs-6 is not working in bootstrap5 so you can use col-6 instead of col-xs-6 and div closing and are used not properly