答案 0 :(得分:1)
您可以尝试以下方法:
<div class="row">
<div class="col-md-4 col-sm-12 col-xs-12"></div>
<div class="col-md-4 col-sm-6 col-xs-6"></div>
<div class="col-md-4 col-sm-6 col-xs-6"></div>
</div>
详细了解Bootstrap grid
答案 1 :(得分:1)
最后两格在移动屏幕col-6
中的更改,第一个是col-12
,
col-xs-*
中的Bootstrap 4
已被col-*
取代
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<div class="container-fluid">
<div class="row">
<div class="col-12 col-sm-4 text-center">
<p>1</p>
</div>
<div class="col-6 col-sm-4 text-center">
<p>2</p>
</div>
<div class="col-6 col-sm-4 text-center">
<p>3</p>
</div>
</div>
</div>
答案 2 :(得分:1)
它是用于引导程序4
var constraints = { video: { facingMode: "environment" } };
答案 3 :(得分:1)
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-4">Box1</div>
<div class="col-xs-6 col-sm-4 col-md-4">Box2</div>
<div class="col-xs-6 col-sm-4 col-md-4">Box3</div>
</div>
</div>
说明:
Bootstrap在一个页面中最多允许12列。
对于移动电话之类的XS设备,按钮/小部件应该占据全部12个网格,因此每行只有1个按钮/小部件,因此col-xs-12
。
由于台式机可以是中型设备,因此3个小部件/按钮应跨越整个页面,因此值为col-md-4
。
希望这会有所帮助。
答案 4 :(得分:1)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-12 col-sm-4 text-center">
<h1>1</h1>
</div>
<div class="col-6 col-sm-4 text-center">
<h1>2</h1>
</div>
<div class="col-6 col-sm-4 text-center">
<h1>3</h1>
</div>
</div>
</div>
</body>
</html>
阅读有关bootstrap 4网格系统的更多信息