Having an issue with the new responsive utilities hidden / visible classes, when migrating to Bootstrap 4. I am aware that .hidden- classes have been removed from v3 and replaced with .hidden-*-up
.hidden-*-down
. Using the new .hidden-*-up.hidden-*-down
classes but the elements aren't changing to visible/hidden. Can't figure out why.
<div class="col hidden-xs-down">
<span class="vcard">
…
</span>
</div>
<div class="col hidden-lg-down">
<div class="hidden-sm-down">
…
</div>
<div class="hidden-xs-down">
…
</div>
</div>
* nothing is hidden in this example, regardless of screen size (Safari, Responsive Design Mode)
Some version working
Bootstrap 4 (^beta) has changed the classes for responsive hiding/showing elements. See this link for correct classes to use: http://getbootstrap.com/docs/4.0/utilities/display/#hiding-elements
****Screen Size Class****
-
Hidden on all .d-none
Hidden only on xs .d-none .d-sm-block
Hidden only on sm .d-sm-none .d-md-block
Hidden only on md .d-md-none .d-lg-block
Hidden only on lg .d-lg-none .d-xl-block
Hidden only on xl .d-xl-none
Visible on all .d-block
Visible only on xs .d-block .d-sm-none
Visible only on sm .d-none .d-sm-block .d-md-none
Visible only on md .d-none .d-md-block .d-lg-none
Visible only on lg .d-none .d-lg-block .d-xl-none
Visible only on xl .d-none .d-xl-block
Refer this link http://getbootstrap.com/docs/4.0/utilities/display/#hiding-elements
With Bootstrap 4
.hidden-*
classes were completely removed (yes, they were replaced byhidden-*-*
but those classes are also gone from v4 alphas). Starting with v4-beta, you can combine.d-*-none
and.d-*-block
classes to achieve the same result. visible-* was removed as well; instead of using explicit.visible-*
classes, make the element visible by not hiding it (again, use combinations of .d-none .d-md-block). Here is the working example:class="hidden-xs"
becomesclass="d-none d-sm-block"
(or d-none d-sm-inline-block) ...An example of Bootstrap 4 responsive utilities: