How to use bootstrap to hide one of div when zoom browser windows size smaller

Jerry Cai picture Jerry Cai · Aug 26, 2013 · Viewed 17.3k times · Source

I use bootstrap to design my web UI , and now I have a requirement as below:

I define the below div structure as their div ids are : part1 and part2

    <div class="container">
        <div class="panel panel-default">
            <div class="panel-body">
                <div id="part1" class="col-md-6">
                    <div>
                        xxxx
                    </div>
                </div>
                <div id="part2" class="col-md-6">
                    <div>
                        yyy
                    </div>
                </div>
            </div>
        </div>
    </div>

Now I want to hide the part1 automatically when shrink browser window size or my phone browser , How can I achieve this effect ?

BTW: I try to add css "collapse" to part1 as , but it hide directly even my browser is larger .

Answer

Metropolis picture Metropolis · Mar 25, 2015

Right Answer for Bootstrap 3

Use utility classes for showing and hiding content by decice via media query. Try to use thses on a limited basis and avoid creating entirely differnet versions of the smae site. Instead, use them to complement each device's presentation.

Screenshot of Bootstrap responsive utility classes

Source: http://getbootstrap.com/css/#responsive-utilities