html
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<!-- all columns can not equal anything greater than 12 -->
<div class="row">
<div class="col-12 text-center">This is a full width column</div>
</div>
<div class="row">
<div class="col-6 text-center">This is a half width column</div>
<div class="col-6 text-center">This is a half width column</div>
</div>
<div class="row">
<div class="col-4 text-center">This is a third width column</div>
<div class="col-4 text-center">This is a third width column</div>
<div class="col-4 text-center">This is a third width column</div>
</div>
<div class="row">
<div class="col-3 text-center">This is a fourth width column</div>
<div class="col-3 text-center">This is a fourth width column</div>
<div class="col-3 text-center">This is a fourth width column</div>
<div class="col-3 text-center">This is a fourth width column</div>
</div>
<div class="row">
<div class="col-2 text-center">1/5</div>
Enter to Rename, Shift+Enter to Preview
css
css
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
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-style: sans-serif;
font-size: 16px;
margin: 0px;
overflow: hidden;
}
body,
html {
height: 100%;
}
.text-center {
text-align: center;
}
.row {
display: table;
table-layout: fixed;
width: 100%;
}
[class*="col"] {
display: table-cell;
overflow: hidden;
padding: 5px 0px;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
alert("Resize the browser window to see the effect.");
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run