Has you can see, i have a navbar with 80px height and exactly 9 elements, but i want this 9 element (div´s/columns) to fill the hole screen.
The with is easy, 100/3=33,3
The height is the problem, i cannot use pixels, and the % don´t work.
Unfortunately CSS doesn’t make it easy to set a percent height and have it fill that %. When you set a % height on something, it calculates % of the parent. If the parent has a % height as well…it doesn’t work. The parent element has to have an explicit height (in pixels).
So you have to resort to javascript to solve this. @bartekkustra wasn’t there some code you made for this problem using some simple jQuery?
If you want to make the div height a percentage of the viewport height, every ancestor of the div, including and , have to have height: 100%, so there is a chain of explicit percentage heights down to the div.
So try to set the height of all the parents be percent height (currently the <html> and <body> elements are set to 100% by default. Then set these to be 33.33%. I think the navbar in that case has to have a % height as well because you can’t mix pixels and % and expect them to equal 100% of the height.