-
Notifications
You must be signed in to change notification settings - Fork 0
/
TP2_exo2_quest2.html
142 lines (125 loc) · 3.52 KB
/
TP2_exo2_quest2.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html>
<head>
<title>TP2_exo2_question2</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
.item1 { grid-area: header;
background-color: blue;
height:70px;
}
.item2 { grid-area: section0;
background-color: khaki;
height:60px;
}
.item3 { grid-area: section1;
background-color: powderblue;
height:100px;
}
.item4 { grid-area: section2;
background-color: lightpink;
height:100px;
}
.item5 { grid-area: section3;
background-color:palegreen;
height:100px;
}
.item6 { grid-area: section4;
background-color: coral;
height:100px;
}
.item7 { grid-area: section5;
background-color: deepskyblue;
height:100px;
}
.item8 { grid-area: section6;
background-color: deepskyblue;
height:100px;
}
.item9 { grid-area: footer;
background-color: mediumpurple;
height:70px;
}
.grid-container {
display: grid;
grid-template-areas:
'header header header header '
'section0 section0 section0 section0 '
'section1 section2 section3 section4 '
'section5 section5 section6 section6 '
' footer footer footer footer ';
grid-gap: 10px;
padding: 10px;
}
.grid-container > div {
border:2px solid black;
text-align: center;
padding-top: 20px;
font-size:30px;
}
@media screen and (max-width:922px) {
.grid-container {
display: grid;
grid-template-areas:
'header header header header '
'section0 section0 section0 section0 '
'section1 section2 section3 section4 '
'section5 section5 section6 section6 '
' footer footer footer footer ';
grid-gap: 10px;
padding: 10px;
}
}
@media screen and (max-width:786px) {
.grid-container {
display: grid;
grid-template-areas:
'header header header header '
'section0 section0 section0 section0 '
'section1 section1 section2 section2 '
'section3 section3 section4 section4 '
'section5 section5 section5 section5 '
'section6 section6 section6 section6 '
' footer footer footer footer ';
grid-gap: 10px;
padding: 10px;
}
}
@media screen and (max-width:576px) {
.grid-container {
display: grid;
grid-template-areas:
'header '
'section0 '
'section1 '
'section2 '
'section3 '
'section4 '
'section5 '
'section6 '
' footer ';
grid-gap: 10px;
padding: 10px;
}
}
</style>
</head>
<body>
<h1>Responsive Web Desigh : HTML & CSS:</h1>
<div class="grid-container">
<div class="item1">Header</div>
<div class="item2">section 0</div>
<div class="item3">section 1</div>
<div class="item4">section 2</div>
<div class="item5">section 3</div>
<div class="item6">section 4</div>
<div class="item7">section 5</div>
<div class="item8">section 6</div>
<div class="item9">footer</div>
</div>
</body>
</html>