[英]how to change bootstrap class col-md-10 into col-md-12 of div using css
I used thumbnail section and view section in my project.我在我的项目中使用了缩略图部分和视图部分。 So I divided parent div into two div, first is col-md-3 (that is thumbnail div) and second is col-md-9 (that is view section).
所以我把父div分成了两个div,第一个是col-md-3 (即缩略图div),第二个是col-md-9 (即视图部分)。 Now I want to hide first div and change second div into col-md-12 for small device like mobile or ipad.
现在我想隐藏第一个 div 并将第二个 div 更改为col-md-12 ,用于移动设备或 ipad 等小型设备。
Is there any way to make it with media query?有什么办法可以用媒体查询来实现吗?
Bootstrap col system for grid has this built in. When you specify col-md-3 you are saying "at medium screen give this col 3 blocks".用于网格的 Bootstrap col 系统内置了这个。当您指定 col-md-3 时,您是在说“在中等屏幕上给这个 col 3 个块”。 You can also do, side by side col-sm-12 to give it the entire row when on large screen and col-sm-0 to hide it when on smaller screens.
您也可以并排使用 col-sm-12 在大屏幕上显示整行,在小屏幕上使用 col-sm-0 隐藏它。 Look here for a better explanation about bootstrap grid system: https://getbootstrap.com/docs/4.1/layout/grid/
在这里查看有关引导网格系统的更好解释: https://getbootstrap.com/docs/4.1/layout/grid/
<div class="row">
<div class="col-md-3 d-none d-sm-none d-md-block">THUMBNAIL</div>
<div class="col-md-9">Some data</div>
</div>
This will solve your issue.这将解决您的问题。 For extra small and small screen thumbnail will not appear.
对于超小和小屏幕缩略图将不会出现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.