/
week9-e.html
202 lines (166 loc) · 5.41 KB
/
week9-e.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<html !DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
/*desktop*/
@media screen and (min-width: 800px){
.main{
display: grid;
padding: 10px;
width: 90%;
margin: auto;
text-align: center;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 150px 150px 150px 150px;
grid-auto-rows:1fr;
grid-auto-columns:150px;
grid-gap: 2em;
grid-template-areas:
'two one one one'
'three six six six'
'four seven seven seven'
'five eight eight eight'
}
.main>.submain:nth-child(1){grid-area: one;}
.main>.submain:nth-child(2){grid-area:two;}
.main>.submain:nth-child(3){grid-area:three;}
.main>.submain:nth-child(4){grid-area:four;}
.main>.submain:nth-child(5){grid-area:five;}
.main>.submain:nth-child(6){grid-area:six;}
.main>.submain:nth-child(7){grid-area:seven;}
.main>.submain:nth-child(8){grid-area: eight;}
.submain{
display: grid;
grid-template-rows: 1fr;
align-items: center;
background-color: skyblue;
grid-template-areas:
'second'
'first'
}
.submain>div:nth-child(1){
background-color: lightseagreen;
font-size: 1em;
grid-area: first;
}
.submain>div:nth-child(2){
background-color: skyblue;
font-size:1em;
grid-area: second;
}
}
/*mobile*/
@media screen and (max-width: 480px){
.submain>div{
display: grid;
/* padding: 10px;
margin: auto;
align-items: center;
font-size: 1.5em;
width: 100%;*/
}
.submain>div:nth-child(1){
background-color: lightseagreen;
grid-template-rows: 2em;
}
.submain>div:nth-child(2){
background-color: skyblue;
grid-template-rows: auto;
}
}
/*tablet*/
@media screen and (max-width: 800px){
.main{
display: grid;
width: 90%;
margin: auto;
grid-template-columns: 1fr 1fr;
grid-gap: 2em;
grid-template-areas:
'spotone spotone'
'coltwo coltwo'
'colthree colfour'
'colfive spotsix'
'spotseven spotseven'
'spoteight spoteight'
}
.submain{
display:grid;
font-size: 1.25em;
text-align: center;
}
.submain>div:nth-child(1){background-color:lightseagreen;}
.submain>div:nth-child(2){background-color:skyblue;}
.spotlight:nth-child(1){grid-area: spotone}
.spotlight:nth-child(6){grid-area: spotsix}
.spotlight:nth-child(7){grid-area: spotseven}
.spotlight:nth-child(8){grid-area: spoteight}
.col:nth-child(2){grid-area: coltwo}
.col:nth-child(3){grid-area: colthree}
.col:nth-child(4){grid-area: colfour}
.col:nth-child(5){grid-area: colfive}
}
/*
THIS TASK REQUIRE YOU TO USE CSS GRID AND THEIR RELATED PROPERTIES
*/
/*ORGANIZE YOUR CSS IN THE FOLLOWING ORDER, IF APPLICABLE
1. ELEMENT SELECTOR
2. ID SELECTOR
3. CLASS SELECTOR
4. DESCENDENT SELECTOR
5. CHILD SELECTOR
6. SIBLING SELECTOR
7. ATTRIBUTE SELECTOR
8. PSEUDO CLASS SELECTOR
FAILURE TO COMPLY WILL RESULTS IN MARK DEDUCTION*/
</style>
</head>
<body>
<!-- INSTRUCTIONS
YOU ARE NOT ALLOWED TO CHANGE ANY PART OF THE HTLM CODES (SUCH AS ADDING ID attributes or additional values to the classes atributes.)
YOUR TASK IS TO WRITE THE CSS CODE TO ACHIEVE THE REQUIRED OUTPUT-->
<div class="main">
<div class="submain spotlight">
<div>Mark Twain</div>
<div>The man who does not read books has no advantage over the one who cannot read them.</div>
</div>
<div class="submain col">
<div>Mason Cooley</div>
<div>Procrastination makes easy things hard and hard things harder.</div>
</div>
<div class="submain col">
<div>Albert Einstein</div>
<div>
A person who never made a mistake never tried anything new.</div>
</div>
<div class="submain col">
<div>Elon Musk</div>
<div>
I think it’s possible to ordinary people to choose to be extraordinary.</div>
</div>
<div class="submain col">
<div>Jim Ryun</div>
<div>
Motivation is what gets you started. Habit is what keeps you going.</div>
</div>
<div class="submain spotlight">
<div>Dr. Seuss</div>
<div>
The more that you read, the more things you will know, the more that you learn, the more places you’ll go.</div>
</div>
<div class="submain spotlight">
<div>Chinese Proverb</div>
<div>
He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever.</div>
</div>
<div class="submain spotlight">
<div>Martin Luther king</div>
<div>
If you can’t fly, then run. If you can’t run, then walk. If you can’t walk, then crawl. But by all means, keep moving</div>
</div>
</div>
</body>
</html>