html - col-xl-* 的静态宽度(Bootstrap 4)?

标签 html css twitter-bootstrap bootstrap-4 grid-system

我如何在 col-xl-* 中禁止它停止为更大的显示器增长? 当我在我的笔记本电脑(1280 宽度)和台式机(1920)上查看它时,两者都适用于 col-xl,但它在台式机上太大或在笔记本电脑上太小。

<div class="d-flex justify-content-center align-items-center text-center login-div ">
    <div class="col-md-6 col-sm-8 col-lg-5 col-xl-3 col-10 rounded-10 mask"></div>
</div>

谢谢。

最佳答案

一种选择是使用 media queries并定义一个 max-width,可能用于 Bootstrap 的 xl breakpoint :

@media (min-width: 1200px) { /* xl */

  .your-class {
    background: yellow;
    max-width: 200px;
  }
}
<div class="your-class">Hello</div>

使用上面的代码,如果视口(viewport)宽度至少为 1200px,则类为 .your-class 的元素的最大宽度为 200px。

关于html - col-xl-* 的静态宽度(Bootstrap 4)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46056210/

相关文章:

javascript - JQuery .load 中的 Bootstrap 下拉列表无法正常工作

html - Phonegap 不显示口音西类牙语单词

javascript - 用Js返回页面的第一张图片src?

html - 标题视频只是扩展到整个页面

html - CSS:在子元素中显示有序列表项索引

javascript - 为什么在 chrome 扩展中有时会出现滚动条有时不会

css - 如何将内部div中的Bootstrap样式恢复为从body继承的样式?

jquery - 具有多个元素的 Bootstrap 轮播不会移动 1 个图像

html - 在html5中绘制对 Angular 线

Javascript 对 SELECT 元素进行排序