Any suggestion on a script that would fill the extra space of a div?
My ultimate goal would be to have this div (the one that should fill the extra space) to push down the div below it so it’s aligned to the bottom.
Below is a visual reference of what I’m trying to do.
I’m using the following Bootstrap panels markup.
<div class="panel panel-default">
<h3 class="panel-title">Panel title</h3>
Why do you need jQuery to do this? Why not absolute positioning?
I went with a combo of suggestions, ultimately all using CSS over jQuery.
Although, I could see a script like this coming in handy.
It would be helpful for others searching if you could post your fix.
@Foxaii, sure thing.
From my original markup, on the class .panel-footer I added the following:
I haven’t worked out the mobile styling yet but I plan on removing position: absolute; since the spacing doesn’t have to match across panels. They’ll just auto height depending on the text they have.
What is the 36px relative to?
You could also do something like this.
min-height: 100px; /* or whatever you need */
padding-bottom: 30px; /* height of panel-footer */
This way the panel footer is always aligned to bottom.
It’s relative to the bottom of the div including the visual padding that should be on the bottom of the button. It’s working out nicely now.
Regarding mobile, I’ve adjusted the position / bottom selector with @media queries.