Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding a column in a fluid bootstrap layout

I'm using bootstrap 3 and AngularJS and I have two column fluid layout.

The two columns are declared like so -

<div class="chart col-md-8">...</div>
<div class="options col-md-4">...</div>

If the user's browser window is less than a certain width, or if they resize it to less than a certain width, I want to hide the options column and make the chart column take up the full width of the screen. How would I do this?

like image 473
sonicboom Avatar asked Dec 07 '22 02:12

sonicboom


2 Answers

Look here:

Responsive Utilities

If you add the .hidden-xs class to the options div it won't be visible for extra small devices (<768px). Find the appropriate class for your usage. You can use a single or a combination of the available classes for toggling content across viewport breakpoints.

<div class="options col-md-4 hidden-xs">...</div>
like image 50
Hein Andre Grønnestad Avatar answered Dec 24 '22 07:12

Hein Andre Grønnestad


Bootstrap provides specis helper classes for this. So for your situation it can be:

<div class="chart col-md-8 col-xs-12">...</div>
<div class="options col-md-4 hidden-xs">...</div>

It means that when xs media query is triggered .options column will be hidden and .chart will expand to full width (12 cols).

like image 33
dfsq Avatar answered Dec 24 '22 09:12

dfsq