-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
42 lines (37 loc) · 842 Bytes
/
style.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
background-color: #f0f0f0;
}
.container {
display: grid;
grid-template-columns: repeat(var(--grid-size), 1fr);
grid-template-rows: repeat(var(--grid-size), 1fr);
width: 60vmin;
height: 60vmin;
gap: 1px;
}
/* Targeting each div inside the container. */
.container {
border: 1px solid #666666;
}
/* using "::after" pseudoelement to change the divs to a square block. This could also be achieved with different means. */
.container > div::after {
content: "";
display: block;
padding-top: 100%; /* Makes the div a square by setting height relative to width */
}
.button {
position: absolute;
top: 20px;
right: 20px;
padding: 15px;
}
.info {
position: absolute;
top: 20px;
left: 20px;
}