-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustify-align.html
48 lines (48 loc) · 1.17 KB
/
justify-align.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Lines</title>
<style>
body {
text-align: center;
color: #fff;
}
#content {
display: grid;
grid-template-columns: repeat(3, 1fr);
/* Set all row 150px */
grid-auto-rows: minmax(150px, auto);
margin: 0 auto;
grid-gap: 10px;
max-width: 960px;
/*for up and down use align-items*/
/* align-items: stretch; */
/*for left and right use justify-items*/
/* justify-items: start; */
}
#content div {
background: green;
padding: 30px;
}
#content div:nth-child(even){
background: black;
}
.one {
justify-self: end;
align-self: end;
}
</style>
</head>
<body>
<div id="content">
<div class="one">1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</body>
</html>