twitter-bootstrap - 容器类的媒体查询

标签 twitter-bootstrap media-queries

我的屏幕尺寸是这样的

Link for testing

27in. Monitor, Dell U2711: 2560px wide x 1440px high
17in. Workstation: 1920px wide x 1200px high
15in. Macbook Pro: 1680px wide x 1050px high
11in. Macbook Air: 1366px wide x 768px high
iPad (Landscape): 1024px wide x 768px high
iPad (Portrait): 768px wide x 1024px high
Nexus7 (Landscape): 966px wide x 603px high
Nexus7 (Portrait): 603px wide x 966px high
iPhone (Landscape): 480px wide x 320px high
iPhone (Portrait): 320px wide x 480px high

我尝试使用媒体查询,但我左对齐,我想要全屏

<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>Layout123</title>
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">



</head>


<body>
<div class="container">

    <div class="row">
        <div class="col-xs-6 col-md-8 col-lg-12">
        <img src="http://chinadomination.com/RC-2.png" class="img-responsive" alt="Responsive image">
        </div>
        </div>

    <div class="row">
        <div class="col-xs-6 col-md-8 col-lg-12">
        <img src="http://chinadomination.com/china_under.png" class="img-responsive" alt="Responsive image">
        </div>
        </div>

</div>  


</body>
</html>

我想将所有桌面的容器居中对齐,移动设备的全屏对齐

最佳答案

您更改了问题,这就是我添加另一个答案的原因

如果您不想在移动 View 中获得尺寸为 6 的列,只需添加 col-lg-12

<style>
.imgCenter{
margin-left: auto;
  margin-right: auto;
}
</style>
    <div class="container">

        <div class="row">
            <div class="col-lg-12">
            <img src="http://chinadomination.com/RC-2.png" class="img-responsive imgCenter" alt="Responsive image">
            </div>
            </div>

        <div class="row">
            <div class="col-lg-12">
            <img src="http://chinadomination.com/china_under.png" class="img-responsive imgCenter" alt="Responsive image">
            </div>
            </div>

    </div>  

关于twitter-bootstrap - 容器类的媒体查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29353592/

相关文章:

html - 垂直和水平居中导致隐藏元素

html - Chrome 中滚动条的媒体查询布局问题

html - 使用 CSS 使两个背景图像与 div 一起响应

CSS:媒体查询以匹配 width < x 和 width >= x。奇怪的行为

jquery - Bootstrap Navbar 展开后不折叠

html - 链接解析错误 - 未捕获错误 : Syntax error, 无法识别的表达式

css - 导航栏的引导媒体查询不起作用

javascript - 是否可以检测父元素内的内容是否太宽而无法容纳?

css - Bootstrap 5 - 将 Radio Buttons Inline 和 Radio Input Group 并排放置

css - 右侧 Bootstrap 上的个人资料图片