-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
86 lines (85 loc) · 2.48 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>flex流式布局</title>
<style>
body{
margin: 0;
padding: 0;
}
.container-fluid{
border: 1px solid #999;
padding: 10px;
}
.row{
width: 100%;
margin-left: 0;
}
[class *="col"] {
display: inline-block;
padding: 10px;
}
.row .box{
height: 50px;
background-color: #eee;
border: 1px solid #999;
}
@media (max-width:768px) {
.col-xs-2 {
width: calc(16.666% - 24px );
}
.col-xs-3 {
width: calc(25% - 24px );
}
.col-xs-6 {
width: calc(50% - 24px );
}
.col-xs-8 {
width: calc(66.666% - 24px );
}
.col-xs-12 {
width: calc(100% - 24px );
}
}
@media (min-width:769px) {
.col-sm-1 {
width: calc(8.333% - 24px );
}
.col-sm-2 {
width: calc(16.666% - 24px );
}
.col-sm-3 {
width: calc(25% - 24px );
}
.col-sm-4 {
width: calc(33.333% - 24px );
}
.col-sm-6 {
width: calc(50% - 24px );
}
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4 col-xs-6"><div class="box">1</div></div>
<div class="col-sm-4 col-xs-6"><div class="box">2</div></div>
<div class="col-sm-4 col-xs-12"><div class="box">3</div></div>
</div>
<div class="row">
<div class="col-sm-3 col-xs-3"><div class="box">4</div></div>
<div class="col-sm-6 col-xs-6"><div class="box">5</div></div>
<div class="col-sm-3 col-xs-3"><div class="box">6</div></div>
</div>
<div class="row">
<div class="col-sm-1 col-xs-2"><div class="box">7</div></div>
<div class="col-sm-1 col-xs-2"><div class="box">8</div></div>
<div class="col-sm-2 col-xs-8"><div class="box">9</div></div>
<div class="col-sm-2 col-xs-3"><div class="box">10</div></div>
<div class="col-sm-6 col-xs-3"><div class="box">11</div></div>
</div>
</div>
</body>
</html>