【问题标题】:Applying Bootstrap 3 grid to a special screen size将 Bootstrap 3 网格应用于特殊的屏幕尺寸
【发布时间】:2018-05-29 06:41:44
【问题描述】:

我有两个 div,分别是 col-xs-12 col-md-9col-xs-12 col-md-3。它们按预期显示

在普通显示器上:

在手机屏幕上:

这是我的问题。我必须使布局适应 1300x1900 像素的特殊屏幕。是的,宽度为 1300 像素,高度为 1900 像素。现在它看起来像这样:

在这种情况下,我需要类似于手机屏幕布局的东西。 Bootstrap 3 是否可以处理这种情况,还是我应该手动处理?

编辑:向现有的 Bootsrap 3 网格添加自定义屏幕宽度并没有真正的帮助。问题在于屏幕比例,而不仅仅是绝对屏幕尺寸。

【问题讨论】:

标签: twitter-bootstrap twitter-bootstrap-3 bootstrap-grid


【解决方案1】:

这里是它的代码:

<<!DOCTYPE html>
  <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  <!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
  <!--[if gt IE 8]><!-->
  <html class="no-js">
  <!--<![endif]-->

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- jQuery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

    <!-- Latest compiled JavaScript -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"></script>
  </head>

  <body>
    <!--[if lt IE 7]>
      <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->


    <div class="container-fluid">

      <div class="container-fluid">
        <div class="row">
          <div class="col-xs-12  col-sm-9 col-md-9 col-lg-9 col-xl-12" style="background-color: red">
          abc</div>
          <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3 col-xl-12" style="background-color: blue">
          def</div>
        </div>
      </div>
    </div>
    <script src="" async defer></script>
  </body>

  </html>

看看 thr fiddle :https://jsfiddle.net/8sydhg9y/1/

【讨论】:

  • 不幸的是,这不能解决我的问题,因为应用简单的引导网格它只考虑屏幕的绝对宽度而不是屏幕比例,正如我在描述中所写的那样。
  • 为什么?有什么问题我没有 1300 1900 分辨率的屏幕我该如何检查但我已经为 xl xtra 大屏幕提供了东西
  • 现在检查我已经添加了最新的引导 css 库 4.1.smth
  • 好像没有效果。无论如何,谢谢,我已经设法手动解决了这个问题。
  • 你可以投赞成票而不是接受的答案
猜你喜欢
  • 2023-04-02
  • 2020-09-15
  • 2015-08-21
  • 1970-01-01
  • 1970-01-01
  • 2017-08-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多