css - 如何在 Bootstrap 4 上定位笔记本电脑和台式机?

标签 css responsive-design bootstrap-4

Bootstrap 最大的网格是 1200 像素宽,但在某些情况下,我必须针对全局最常见的两种分辨率(1366x768 和 1920x1080)调整 CSS。

在 Bootstrap 4 中定位笔记本电脑(> 1200 < 1400)和实际台式机(> 1400)的正确方法是什么?

最佳答案

看看这是否对你有帮助:
https://codepen.io/panchroma/pen/GxLVyp

HTML

<div class="container">
 <!-- content here -->
</div>  

CSS

@media (min-width: 1200px) and (max-width: 1400px){ 
  .container{
    max-width: 1168px;
    background-color:olive;
  }
}

@media (min-width: 1401px) { 
  .container{
    max-width: 1368px;
    background-color:teal;
  }
}  

根据需要为这 2 个新媒体查询编辑最大宽度和其他样式。

上面的应该适用于 Bootstrap 4 auto layout columns同样,这里有一个例子:https://codepen.io/panchroma/pen/VXOZVW

祝你好运!

关于css - 如何在 Bootstrap 4 上定位笔记本电脑和台式机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49797877/

相关文章:

css - 使用 Grid Material UI 时出现响应式设计问题?

html - 使用 CSS 在响应图像上进行背景翻转

java - 如何在多列 linkki 部分中跨越多列

html - 文本与百分比大小的图像右对齐

javascript - 有什么办法可以实时改变元素的宽度?

jquery - CSS 过渡不适用于 jQuery 切换类

jquery - 根据图像大小和窗口大小显示图像的不同方式

html - 当窗口减半时如何使卡不拉伸(stretch)

css - 将 bootstrap 4 导航栏保持在顶部且透明

html - 如何修改 Bootstrap 的卡片列?