Reputation: 301
I've been searching for a solution to this issue in the last 3 days with no result at all.
So, I have an HTML page that have to fit the window, and I'm using bootstrap 4.1.1. This page is pretty simple:
The whole code is about 250 rows, so I'll try to write just an example of what I need:
<body>
<div id="header" class="container-fluid">
<!--Bootstrap rows and stuffs that actually work well
</div>
<div class="container-fluid">
<div class="row" id="main-row">
<!--FIRST COLUMN: SUMMARY-->
<div id="menu" class="col-2 box">
<!--Here i have a navbar menu-->
</div>
<!--SECOND COLUMN: CONTENT-->
<div id="content" class="col-8 box">
<!--Here i have contents: one video tag and one carousel-->
</div>
<!--THIRD COLUMN: DESCRITPION-->
<div id="description" class="col-2 box">
<!--Here i some text-->
</div>
</div>
</div>
I just need the whole second container-fluid (or the single row in it) to fill the rest of the window keeping every column at that height.
Here's what I've tried:
Fun fact: bootstrap columns ignore body height at all and they go over its bottom limit.
Upvotes: 2
Views: 1671
Reputation: 301
In case this could help someone, I've solved this with a workaround.
Bootstrap almost doesn't care about heights and keeps them fixed (what I mean is, for example, that the header doesn't resize its height if the window height is reduced). So declaring the header height at (in my case, it fits perfectly) 165px allowed me to calculate the height of the second row with
height: calc(100vh - 165px);
Not the best solution ever but it works
Upvotes: 1
Reputation: 1
Use card groups to render cards as a single, attached element with equal width and height columns. Card groups use display: flex; to achieve their uniform sizing. https://getbootstrap.com/docs/4.0/components/card/
you can also create new class like this .equalhight{display:flex;} and can apply it to the top most div.
This is my first post. Thanks.
Upvotes: 0