i’m looking for a solution to fit the columns of Twitter Bootstrap into the Body. Like the example below. Is there a robust way to do it? Because if i’m trying it with height:100% or position absolute (and top:0, bottom:0, etc.) it doesn’t work as expected (or i have a scrollbar).
So how can i fit the col’s into the body height, but on mobile (col-xs-…) to fallback to the “normal” bootstrap usage?
Thanks a lot!
Desktop view
+---------------------------+---------------------+
| LOGO ETC | OTHER STUFF |
| Height: ~20% | Height: ~20% |
+---------------------------+---------------------+
| | |
| | |
| Navigation | Content |
| 80% | 80% |
| | |
| | |
| | |
| | |
| | |
+------------+------------------------------------+
Mobile View:
+---------------------------+
| LOGO ETC |
+---------------------------+
| OTHER STUFF |
+---------------------------+
| |
| Navigation |
| |
+---------------------------+
| |
| Content |
| |
| |
+---------------------------+
4
Answers
Since there isn’t any code coming up from you, here is a little example of how it could work.
https://jsfiddle.net/hwp9qw34/
You can simply add some customized
media-queries
to yourdiv
s. Another approach to deal with that would be the usage of Bootstraps.visible-*-*
and.hidden-*-*
classes. But note: This would totally end up in bloating up your html and redundant markup which would lead to a slow(er) performance.You can see here in my bin. If you look on snippet just make a full screen view.
Click Full page to view your desktop view.
You have to set the height of the body(parent of the div) to have the height in % of the div to work and in turn set the height of the html (parent of body).