如何使用 Bootstrap 4 Beta 在小屏幕上隐藏元素 [英] How to hide element on small screens with Bootstrap 4 Beta

查看:62
本文介绍了如何使用 Bootstrap 4 Beta 在小屏幕上隐藏元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从 bootstrap 4 alpha 迁移到 beta,但我现在不知道如何在小屏幕上隐藏元素.在 alpha 中,这是hidden-md-up"和hidden-sm-down",效果很好.hidden-md-up"现在是d-md-none",但另一个我无法上班

I just moved from bootstrap 4 alpha to beta, but I can't figure out how to hide an element on a small screen now. In the alpha this was "hidden-md-up" and "hidden-sm-down" which worked beautifully. "hidden-md-up" is now "d-md-none", but the other one I can't get to work

<div class="d-md-block d-xs-none d-sm-none">Show on large screen only - NOT working for me</div>
<div class="d-md-none">Show on small screen only</div>

有什么想法吗?

推荐答案

短暂的休息,喝杯咖啡后我想通了:添加类d-none d-md-block"就行了

A short break, cup of coffee later I figured it out: Adding the class "d-none d-md-block" will do the trick

<div class="d-none d-md-block">Show on large screen only works now</div>
<div class="d-md-none">Show on small screen only</div>

Bootstrap 4 文档.

这篇关于如何使用 Bootstrap 4 Beta 在小屏幕上隐藏元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆