-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
108 lines (99 loc) · 2.93 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<html lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS3 Flexbox - Hongkiat.com</title>
<!-- jquery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../_nav/js/jquery.js"><\/script>')</script>
<!-- demo scripts -->
<link rel="stylesheet" href="css/style.css">
<!-- nav script -->
<script src="../_nav/js/nav.js" type="text/javascript"></script>
</head>
<body>
<!-- nav meta -->
<div class="demo-meta">
<h1 class="demo-title">CSS3 Flexbox</h1>
<p class="demo-desc">This demo shows how to use CSS3 Flexbox to create columns.</p>
</div>
<!-- demo content -->
<div class="wrapper">
<!-- Old Way -->
<section class="old">
<h3>Old Way</h3>
<div class="cf">
<div class="col left">
<p>Pastry icing sweet roll fruitcake croissant. Tart wypas tiramisu marshmallow marshmallow sweet roll. Cheesecake bear claw pudding bonbon sweet roll powder carrot cake. Cake sweet donut tart.</p>
</div>
<div class="col right">
<p>Dessert gummies sweet roll. Dessert gummi bears soufflé cotton candy icing. Lollipop wafer lemon drops toffee chocolate.</p>
</div>
</div>
<pre>
.old .col {
float: left;
}
.old .left {
width: 310px;
}
.old .right {
width: 210px;
}
</pre>
</section>
<!-- Flexbox Way -->
<section class="new">
<h3>Flexbox</h3>
<div class="flex">
<div class="col left">
<p>Pastry icing sweet roll fruitcake croissant. Tart wypas tiramisu marshmallow marshmallow sweet roll. Cheesecake bear claw pudding bonbon sweet roll powder carrot cake. Cake sweet donut tart.</p>
</div>
<div class="col right">
<p>Dessert gummies sweet roll. Dessert gummi bears soufflé cotton candy icing. Lollipop wafer lemon drops toffee chocolate.</p>
</div>
</div>
<pre>
.flex {
display: -webkit-flex;
display: flex;
}
</pre>
</section>
<!-- Flexbox Way -->
<section class="new">
<h3>Flexbox</h3>
<div class="flex2">
<div class="col left">
<p>Pastry icing sweet roll fruitcake croissant. Tart wypas tiramisu marshmallow marshmallow sweet roll. Cheesecake bear claw pudding bonbon sweet roll powder carrot cake. Cake sweet donut tart.</p>
<p>Pastry icing sweet roll fruitcake croissant. Tart wypas tiramisu marshmallow marshmallow sweet roll. Cheesecake bear claw pudding bonbon sweet roll powder carrot cake. Cake sweet donut tart.</p>
</div>
<div class="col right">
<p>Dessert gummies sweet roll. Dessert gummi bears soufflé cotton candy icing. Lollipop wafer lemon drops toffee chocolate.</p>
</div>
</div>
<pre>
.flex2 {
display: -webkit-flex;
display: flex;
}
.flex2 .left {
width: 310px;
}
.flex2 .right {
width: 210px;
}
.flex2 .left {
display: -webkit-flex;
display: flex;
}
.flex2 .left p:nth-child(1) {
padding-right: 10px;
}
.flex2 .left p:nth-child(2) {
padding-left: 10px;
}
</pre>
</section>
</div>
</body>
</html>