6.2.2 多余的列另起一行

Bootstrap的每行被分成12等分,如果用户在同一行内指定的所有单元格宽度加起来超过了12,则超过部分的单元格将会自动换行。例如如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

<html>

<head>
<meta name="author" content="Yeeku.H.Lee(CrazyIt.org)" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> 网格 </title>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.min.css">
<style type="text/css">
.row {
margin-bottom: 20px;
}

[class*="col-"] {大专栏  6.2.2 多余的列另起一行n>
padding-top: 15px;
padding-bottom: 15px;
background-color: #eee;
background-color: rgba(86, 61, 124, .15);
border: 1px solid #ddd;
border: 1px solid rgba(86, 61, 124, .2);
}
</style>
</head>

<body>
<div class="container">
<div class="row">
<div class="col-sm-9 col-md-9 col-lg-9">第一行(1).col-xx-9</div>
<div class="col-sm-4 col-md-4 col-lg-4">第一行(2).col-xx-4
<br>由于 9 + 4 = 13 &gt; 12, 因此该单元格将会自动另起一行</div>
<div class="col-sm-6 col-md-6 col-lg-6">第一行(3).col-xs-6
<br>
</div>
</div>
</div>
<script type="text/javascript" src="../jquery-3.1.1.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
</body>

</html>

该示例定义了一行,该行内第一个单元格占9列宽度,第二个单元格要占4列宽度,这样两个单元格加起来就超过了12列,因此第二个单元格会自动换行。

原文链接: 6.2.2 多余的列另起一行

猜你喜欢

转载自www.cnblogs.com/lijianming180/p/12409572.html
今日推荐