Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap hidden-sm-down not working

I am using Boostrap 3. Why the <div> with hidden-sm-down is still visible when I resize the page on my laptop? I want to hide those two images on small devices in order to have a different menu.

<div class="row">                 
    <div class="col-md-7 left">
        <ul class="row">
            <li class="col-md-2">
                <a href="">Text</a>
            </li>
            <li class="col-md-2">
                <a href="">Text</a>
            </li>
            <li class="col-md-3">
                <a href="">Text</a>
            </li>
            <li class="col-md-3">
                <a href="">Text</a>
            </li>
            <li class="col-md-2">
                <a href="">Text</a>
            </li>
        </ul>
    </div>
    <div class="col-md-1 hidden-sm-down wave">
        <img src="img/ondina.png" />
    </div>
    <div class="col-md-3 right">
        <ul class="row">
            <li class="col-md-6">
                <a href="">Text</a>
            </li>
            <li  class="col-md-6">
                <a href="">Text</a>
            </li>
        </ul>
    </div>
    <div class="col-md-1 hidden-sm-down right-border">
        <img src="img/menu-right.png"  />
    </div>
</div>
like image 958
user1315621 Avatar asked Jun 11 '16 14:06

user1315621


People also ask

What is hidden SM down?

hidden-*-down class to show an element only on a given interval of screen sizes. For example, . hidden-sm-down. hidden-xl-up shows the element only on medium and large viewports.

How do I hide div in small screen in bootstrap 4?

To hide elements simply use the .d-none class or one of the .d-{sm,md,lg,xl}-none classes for any responsive screen variation.


2 Answers

Actually, hidden-sm-down won't work with Bootstrap 4 and above
(there use d-none instead of hidden-sm-down, and use d-sm-none instead of hidden-sm-up, see also understanding-details).

With BS4, display utility classes are completely changed. Use this format instead;

.d-{breakpoint}-{value}

More information ; https://getbootstrap.com/docs/4.0/utilities/display/

like image 166
merkdev Avatar answered Oct 23 '22 11:10

merkdev


As Jaqen said, if you use Bootrstrap 3, you should use hidden-sm instead.

Also, if you want to hide the image on small screen, you have to add hidden-xs.

Here's a JsFiddle : DEMO

like image 40
Mathieu Schaeffer Avatar answered Oct 23 '22 10:10

Mathieu Schaeffer