Search code examples
bootstrap-4hiddendisplay

What is the Bootstrap 4.0+ equivalent to ".hidden-size-down/up"


<div class="justify-content-center">
  <p class="hidden-md-down"> TEXT </p>
</div>

BootStrap used to be able to 'hide' a element on resizing using '.hidden'.

It looks like this no longer works.

What is the 4.0+ equivalent?


Solution

  • Bootstrap 4 has the .d-none class. (official documentation)

    To hide an element on screens smaller than 960px you could use the class's d-none & d-lg-block

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