twitter-bootstrap - 将 Bootstrap 3 网格应用于特殊的屏幕尺寸
问题描述
我有两个 divcol-xs-12 col-md-9
和col-xs-12 col-md-3
。它们按预期出现
在普通显示器上:
在手机屏幕上:
这是我的问题。我必须使布局适应 1300x1900 像素的特殊屏幕。是的,宽度为 1300 像素,高度为 1900 像素。现在它看起来像这样:
在这种情况下,我需要类似于手机屏幕布局的东西。Bootstrap 3 是否可以处理这种情况,还是我应该手动处理?
编辑:将自定义屏幕宽度添加到现有的 Bootsrap 3 网格并没有真正帮助。问题在于屏幕比例,而不仅仅是绝对屏幕尺寸。
解决方案
这是它的代码:
<<!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/
推荐阅读
- data-structures - 需要多少探针才能避免散列冲突?
- sql - 从上一行更新记录
- javascript - 列表/手风琴在按钮上方的定位?(语义用户界面)
- cmake - 如何通过使用特殊参数调用 cmake 来更改 CMakeLists.txt 中的选项
- jitsi - JITSI 视频会议 - 当主持人/主持人离开会议时,是否有任何配置或 API 可以踢出所有参与者?
- php - Domdocument:为什么 XSLT 转换输出变成单行?
- arm - gem5 完整系统 Linux 启动失败并显示“内核恐慌 - 未同步:VFS:无法挂载根 fs”
- html - 如何将此菜单分成两列?
- vue.js - 从 Vue 指令中获取目标元素
- amazon-web-services - 如何检查 dynamoDB 表被访问的次数