18

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>
Jaqen H'ghar
  • 16,186
  • 8
  • 49
  • 52
user1315621
  • 3,044
  • 9
  • 42
  • 86

4 Answers4

26

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/

Top-Master
  • 7,611
  • 5
  • 39
  • 71
merkdev
  • 931
  • 10
  • 8
18

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

13

You mention you use Bootstrap 3

Use hidden-sm instead of hidden-sm-down which belongs to Bootstrap 4

On a side note:

You also mention:

I want to hide those two images on small devices in order to have a different menu.

hidden-sm will hide the element on small screens such as iPad. To hide on extra small screens (such as Phones < 768px) add hidden-xs.

Take a look at the Bootstrap sizes table here

Jaqen H'ghar
  • 16,186
  • 8
  • 49
  • 52
6

If you are using Bootstrap 4, you can utilize the following:

Hidden only on small screens

<div class="d-none d-lg-block">hidden on screens smaller than lg</div>

Visible only on small screens

<div class="d-none d-sm-block d-md-none">visible on small screens</div>
Joseph
  • 5,644
  • 3
  • 18
  • 44
Yuvraj Patil
  • 7,944
  • 5
  • 56
  • 56