html - Bootstrap v4.4.1 d-md-none 在大屏幕上隐藏项目
问题描述
我正在使用 Bootstrap v4.4.1 卡片在大屏幕上显示 3 张卡片,并在中屏幕上隐藏和显示 2 张卡片。我正在使用d-md-none
类在 md 屏幕上隐藏第三张卡片,但它在所有屏幕上隐藏第三张卡片。
不知道我做错了什么。
<div class="container mt-5">
<div class="row">
<div class="col-xl-4 col-md-6">
<div class="card" >
<img src="images/trophy.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="col-xl-4 col-md-6">
<div class="card" >
<img src="images/trophy.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="col-xl-4 d-md-none">
<div class="card" >
<img src="images/trophy.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
</div>
</div>
解决方案
添加类d-none d-lg-block
<div class="col-xl-4 d-none d-lg-block">
推荐阅读
- r - paste0() changes format of date
- batch-file - 文件夹内的批处理文件以创建 MediaInfo.nfo 文件
- laravel - 合并为一个集合
- javascript - 在javascript中将字符串解析为二维整数数组
- node.js - 在 vscode 中使用 Typescript 时,我无法让智能感知工作
- amazon-web-services - 我们应该在 Redshift 的存储过程中使用 udf
- python - 如何在 Python 中将多个生成器传递给 FunAnimation?
- python - 返回最常用词的函数
- java - 将使用 Files.readAllBytes 加载的字节打印到数组中
- python - 处理多个变量的类似异常