css - Bootstrap 居中 100% 宽度覆盖响应

标签 css twitter-bootstrap responsive-design containers twitter-bootstrap-3

我在使用 bootstrap 的容器类时遇到了麻烦,因为我需要一个响应式 100% 宽度的封面。如果我使用这个类,我会在左边和右边得到一个小的边距。所以我希望利润率下降。我怎样才能做到这一点并仍然获得响应?

这是容器类:

.container {
    margin-left: auto;
    margin-right: auto;
}

如果我使用宽度为 100% 的 col-12 类,当我调整大小时图像会偏向一侧,并且当我调整大小时我需要居中图像。

这是使用容器类的封面,你注意到右边距和左边距

enter image description here

这是我使用 col-12 类时的样子:

enter image description here

这就是我需要的,但没有边距。 (当然只有当我在 100% 时)

enter image description here

谢谢。

最佳答案

我修复了 100% 宽度改变这个:

@media (min-width: 1200px) {
    .container {
    max-width: 1170px;
    }
}

对此:

@media (min-width: 1200px) {
    .container {
    max-width: 1280px;
    }
}

那是因为 1280px 是我屏幕的分辨率。

关于css - Bootstrap 居中 100% 宽度覆盖响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18028105/

相关文章:

c# - 防止 "Edit"用户控件上的 CSS 更改?

css - 悬停时向多个元素添加样式 - scss

html - 为什么我的带有五个 20% 宽度 <li> 的 <ul> 导航栏在 100% 宽度的父 div 中开始一个新行?

html - 菜单不适用于移动设备

css - Bootstrap 3 : img-responsive not working with pull-right

html - DIV 在小屏幕上不会消失

html - 让div用动态同级填充父级的高度

css - 将div设置为子图像的宽度和高度?

html - 如何设置 Bootstrap 页脚的样式?

html - JqueryMobile 添加一个 2 列表