The footer is there. The problem is just that you can't set the div#tabs
with height: 100%, because the outer div has overflow:hidden
It will have the same height as its container, but as the footer is at the same level as the div#tabs
, it will be hidden, because the div.ui-layout-center
has the overflow:hidden
.
First solution: change the height of div#tabs
to a lower percentage:
<div style="margin-bottom: 10px; height: 100px; background: #ffff00;"></div>
<div id="tabs" style="height: 40%; overflow: auto">
content
</div>
<div style="background: #ff0000; height: 100px; ">footer</div>
https://jsfiddle.net/y57v3nkf/1/
Second solution, change the overflow option of the outer div to automatic:
https://jsfiddle.net/y57v3nkf/2/
Third Solution (Jquery Brute force):
Set the outer div to 100% height, and:
$(document).ready(function(){
var outerDivHeight = $('div.ui-layout-center').height();
var tabDivHeight = outerDivHeight - 100 - 100 -10;
$('#tabs').height(tabDivHeight);
});
https://jsfiddle.net/y57v3nkf/3/
Porblems with this solution:
- You have to do calculations.
- It gets the correct height when page
loads, but then it doesn't if the page is resized.
TIP: Go percentual:
These layouts get really tricky when you have fixed size divs along with percentual divs. To go fully responsive, you'll have to redo all the layout thinking in percentages, example:
|-------------100%-----------------|
|---20%----|------------80%--------|
|....|.....|.....|.................|