-1

I want to show a button when screen size less is than 768 only. I am using latest version of bootstrap(4.1.1). From a straightforward reference(https://v4-alpha.getbootstrap.com/layout/responsive-utilities/ ) I tried as follows:

  <button type="button" id="leftSidebarCollapse" class="navbar-btn  hidden-md-down">
                        <span></span>
                        <span></span>
                        <span></span>
                    </button>

According to bootstrap 4, this button should be visible when screen size less is than 768 only. But it is not working as expected. It kill my day. Whats wrong is going on my code? Any idea?

Abdus Sattar Bhuiyan
  • 3,016
  • 4
  • 38
  • 72
  • Check the current docs, alpha is outdated: https://getbootstrap.com/docs/4.1/utilities/display/#hiding-elements – Klooven May 22 '18 at 09:45

1 Answers1

1

You will need to use bootstrap d-sm-block d-md-none classes for Visible only less than small screen.

<button type="button" id="leftSidebarCollapse" class="navbar-btn d-sm-block d-md-none">
 <span></span>
 <span></span>
 <span></span>
</button>

Please check here bootstrap Display property

HDP
  • 4,005
  • 2
  • 36
  • 58