Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,540 --> 00:00:04,900
Now it's time for the first big coding challenge
2
00:00:04,900 --> 00:00:08,083
in this course, so let's get started.
3
00:00:09,570 --> 00:00:12,740
Now, before we start with the actual challenge,
4
00:00:12,740 --> 00:00:16,510
I want to first make some changes to the file structure
5
00:00:16,510 --> 00:00:19,100
that we have in this project right now.
6
00:00:19,100 --> 00:00:21,410
And in particular, what I want to do
7
00:00:21,410 --> 00:00:24,870
is to put all the images into one folder,
8
00:00:24,870 --> 00:00:29,750
so that I can then show you how we can include the images,
9
00:00:29,750 --> 00:00:34,620
like this, when they are located in a specific folder.
10
00:00:34,620 --> 00:00:38,720
So right now they are all, as we can see here,
11
00:00:38,720 --> 00:00:41,570
they are all in the same, exact same folder
12
00:00:41,570 --> 00:00:43,960
as the index.html.
13
00:00:43,960 --> 00:00:46,650
And so that's why all we have to do
14
00:00:46,650 --> 00:00:48,800
is to declare the name here,
15
00:00:48,800 --> 00:00:51,050
and the browser will then find them
16
00:00:51,050 --> 00:00:54,193
basically in the same folder as the HTML document.
17
00:00:55,320 --> 00:00:59,760
But now let's create a new folder by clicking this icon,
18
00:00:59,760 --> 00:01:02,810
and I'm gonna call it IMG,
19
00:01:02,810 --> 00:01:06,093
and then I'm going to put all of the images there.
20
00:01:09,710 --> 00:01:12,973
So just dragging and dropping them like this.
21
00:01:15,240 --> 00:01:16,420
Okay.
22
00:01:16,420 --> 00:01:19,060
And so now if we reload the page,
23
00:01:19,060 --> 00:01:22,010
and not this one, which is our demo,
24
00:01:22,010 --> 00:01:23,623
but the one we're working on.
25
00:01:26,650 --> 00:01:29,130
And by the way, this time I had to actually
26
00:01:29,130 --> 00:01:31,200
manually reload the page,
27
00:01:31,200 --> 00:01:35,360
because I had my computer turned off in the meantime.
28
00:01:35,360 --> 00:01:37,010
And so whenever you do that,
29
00:01:37,010 --> 00:01:38,640
the very first time you come back,
30
00:01:38,640 --> 00:01:42,150
you will have to manually reload the page here,
31
00:01:42,150 --> 00:01:45,220
when you are running the live server extension.
32
00:01:45,220 --> 00:01:49,120
Okay, so remember that we installed that in the last video,
33
00:01:49,120 --> 00:01:52,350
and so if I do some change here now,
34
00:01:52,350 --> 00:01:57,350
then that should probably just work just before.
35
00:01:58,550 --> 00:02:02,223
So you see there is some change, and there it appears.
36
00:02:03,130 --> 00:02:06,600
But anyway, you see that now that we have
37
00:02:06,600 --> 00:02:09,890
these images inside of the IMG folder,
38
00:02:09,890 --> 00:02:14,890
they are no longer found in the same folder as index.html.
39
00:02:15,090 --> 00:02:17,653
So that's why they don't appear up here.
40
00:02:19,100 --> 00:02:20,790
So what we need to do here
41
00:02:20,790 --> 00:02:24,290
is to change the path to the image now,
42
00:02:24,290 --> 00:02:26,680
and that's not a difficult problem.
43
00:02:26,680 --> 00:02:29,450
All we have to do is to start a new path
44
00:02:29,450 --> 00:02:31,570
with the name of the folder.
45
00:02:31,570 --> 00:02:36,570
So that's IMG. and then slash, and so here we go.
46
00:02:37,940 --> 00:02:42,043
So you see the image appears here now again, in this gutter.
47
00:02:43,750 --> 00:02:46,690
And so let's do the same thing here,
48
00:02:46,690 --> 00:02:50,273
give it a save, and here are our images back.
49
00:02:51,420 --> 00:02:52,253
Okay.
50
00:02:52,253 --> 00:02:55,760
So usually we always put the images in a separate folder.
51
00:02:55,760 --> 00:02:58,740
And so I thought that was important to show you,
52
00:02:58,740 --> 00:03:01,080
especially now before this challenge,
53
00:03:01,080 --> 00:03:03,493
where we are going to use some more images.
54
00:03:04,550 --> 00:03:07,870
So about the challenge, and being here,
55
00:03:07,870 --> 00:03:09,880
back in the demo page,
56
00:03:09,880 --> 00:03:12,310
and so essentially what I want you to do
57
00:03:12,310 --> 00:03:15,523
is to code on your own this part here.
58
00:03:16,850 --> 00:03:19,350
All right, and let me actually show you
59
00:03:19,350 --> 00:03:23,563
where that should be in our markup, so in our HTML,
60
00:03:24,780 --> 00:03:28,383
and it is right here after the article.
61
00:03:29,360 --> 00:03:30,220
Okay?
62
00:03:30,220 --> 00:03:32,830
So this section here about the related posts
63
00:03:32,830 --> 00:03:36,020
is no longer part of the article.
64
00:03:36,020 --> 00:03:38,470
It's also not part of the footer,
65
00:03:38,470 --> 00:03:41,460
and so here we will need another element.
66
00:03:41,460 --> 00:03:44,190
And this one I will actually write for you.
67
00:03:44,190 --> 00:03:48,510
So here we are going to use the aside element,
68
00:03:48,510 --> 00:03:51,100
and the aside element is usually used
69
00:03:51,100 --> 00:03:53,640
for some secondary information
70
00:03:53,640 --> 00:03:55,770
that compliments the information
71
00:03:55,770 --> 00:03:58,270
in the main part of the page.
72
00:03:58,270 --> 00:04:01,670
So in this case, the main part of the page is the article.
73
00:04:01,670 --> 00:04:04,900
And then the aside, which is secondary information
74
00:04:04,900 --> 00:04:06,910
is basically some related posts
75
00:04:06,910 --> 00:04:11,300
that are related to the article, so to the main part.
76
00:04:11,300 --> 00:04:12,300
Okay?
77
00:04:12,300 --> 00:04:15,420
Now visually many times we use the aside element
78
00:04:15,420 --> 00:04:17,120
as a sidebar,
79
00:04:17,120 --> 00:04:19,480
but it doesn't have to be that way.
80
00:04:19,480 --> 00:04:23,260
Okay, but now about the challenge itself.
81
00:04:23,260 --> 00:04:27,020
So you see that it starts here with this heading.
82
00:04:27,020 --> 00:04:30,470
So you can experiment which heading is best here.
83
00:04:30,470 --> 00:04:35,170
So one of the headings, H1, two, three, four, five, and six,
84
00:04:35,170 --> 00:04:37,990
remember, and then here you see
85
00:04:37,990 --> 00:04:40,610
that this is actually a list, right?
86
00:04:40,610 --> 00:04:43,760
You can see that because of these bullet points.
87
00:04:43,760 --> 00:04:48,280
And so here for this part, you should probably use a list.
88
00:04:48,280 --> 00:04:52,390
Now, what we didn't do before was to have multiple elements
89
00:04:52,390 --> 00:04:54,523
inside of one list item.
90
00:04:55,490 --> 00:04:57,900
So up here, for example, we have the list item,
91
00:04:57,900 --> 00:05:00,600
and in there there's only some text,
92
00:05:00,600 --> 00:05:03,520
but you see that here in each item, there is an image,
93
00:05:03,520 --> 00:05:07,600
a link, and then some more texts here.
94
00:05:07,600 --> 00:05:09,320
And that's no problem at all.
95
00:05:09,320 --> 00:05:11,750
So inside of each list element,
96
00:05:11,750 --> 00:05:16,510
there can be multiple other child elements, right?
97
00:05:16,510 --> 00:05:18,410
And so with that information,
98
00:05:18,410 --> 00:05:21,380
I think you are now able to build this.
99
00:05:21,380 --> 00:05:23,800
Now, finally, just about the images here,
100
00:05:23,800 --> 00:05:26,320
that some are information that you need.
101
00:05:26,320 --> 00:05:28,920
They are also in this folder,
102
00:05:28,920 --> 00:05:32,100
and they are called related-1, two, and three.
103
00:05:32,100 --> 00:05:37,100
And the dimensions want you to give them is 75 by 75 pixels.
104
00:05:38,090 --> 00:05:40,020
And now I think I gave you everything,
105
00:05:40,020 --> 00:05:42,630 line:15%
so please pause the video now,
106
00:05:42,630 --> 00:05:46,290 line:15%
and take a couple of minutes, 10, 15 minutes maybe,
107
00:05:46,290 --> 00:05:49,370 line:15%
to write up the HTML for this section.
108
00:05:49,370 --> 00:05:52,913 line:15%
So good luck with that, and I'll see you once you're ready.
109
00:05:55,400 --> 00:05:56,383 line:15%
All right.
110
00:05:57,260 --> 00:06:01,733
So hopefully you did this just fine.
111
00:06:03,000 --> 00:06:05,053
So let me show you how I did it.
112
00:06:07,860 --> 00:06:11,120
And I hope that you start to see how helpful it is
113
00:06:11,120 --> 00:06:14,342
that VSCode now automatically closes
114
00:06:14,342 --> 00:06:17,193
our HTML elements, right?
115
00:06:19,420 --> 00:06:24,420
So the source here is in the IMG folder, and then related-1.
116
00:06:27,550 --> 00:06:31,450
Then the alt text, let's just say,
117
00:06:31,450 --> 00:06:34,433
that this is a person programming.
118
00:06:36,630 --> 00:06:38,760
And of course, your alt text
119
00:06:38,760 --> 00:06:40,960
doesn't have to be exactly the same as mine.
120
00:06:42,100 --> 00:06:44,880
So if your alt text is a bit different,
121
00:06:44,880 --> 00:06:46,853
that is not a problem at all.
122
00:06:48,380 --> 00:06:50,423
And now we need to close it as well.
123
00:06:52,210 --> 00:06:55,350
And so that's the image part.
124
00:06:55,350 --> 00:06:59,860
Next, we have a hyperlink, so an anchor tag,
125
00:06:59,860 --> 00:07:04,860
and here the href, which is something that I didn't mention,
126
00:07:05,360 --> 00:07:07,550
but hopefully you figured it out,
127
00:07:07,550 --> 00:07:09,040
that this is one of the links
128
00:07:09,040 --> 00:07:11,433
that should not point anywhere for now.
129
00:07:13,440 --> 00:07:17,487
So How to Learn Web Development.
130
00:07:20,780 --> 00:07:24,350
And now finally there's some text with the author there,
131
00:07:24,350 --> 00:07:28,003
and so we can use a paragraph for that.
132
00:07:29,000 --> 00:07:31,423
So by Jonas Schmedtmann.
133
00:07:32,720 --> 00:07:34,920
Okay, giving it a save.
134
00:07:34,920 --> 00:07:39,220
Now it's nicely formatted, and it should appear down here.
135
00:07:39,220 --> 00:07:41,363
And indeed here it is.
136
00:07:42,380 --> 00:07:46,313
Great, oh, I'm just missing here the heading actually.
137
00:07:47,200 --> 00:07:49,900
So let me go back, and put that
138
00:07:49,900 --> 00:07:54,900
even before the unordered list, so I'm using an h4 for that.
139
00:08:01,990 --> 00:08:05,350
But anyway, let's continue now building our list here
140
00:08:05,350 --> 00:08:07,363
with the next list item.
141
00:08:11,160 --> 00:08:13,710
And by the way, if you did your code
142
00:08:13,710 --> 00:08:15,360
a little bit different from mine,
143
00:08:16,720 --> 00:08:18,940
that's really not a problem.
144
00:08:18,940 --> 00:08:20,800
What matters here is that you
145
00:08:20,800 --> 00:08:22,673
tried writing the code on your own.
146
00:08:26,690 --> 00:08:29,010
That is really the most important thing
147
00:08:29,010 --> 00:08:30,833
that I was expecting you to do here.
148
00:08:32,290 --> 00:08:37,073
So width of 75, the height also 75.
149
00:08:41,500 --> 00:08:44,083
(keys tapping)
150
00:08:46,230 --> 00:08:49,770
Then again, a link pointing nowhere.
151
00:08:49,770 --> 00:08:54,727
And this one is The Unknown Powers of CSS,
152
00:08:59,760 --> 00:09:02,950
and by Jim Dillon.
153
00:09:02,950 --> 00:09:07,620
And I'm not going to check out the result just yet,
154
00:09:07,620 --> 00:09:09,493
let's just finish it.
155
00:09:11,020 --> 00:09:12,433
So another image.
156
00:09:14,160 --> 00:09:16,600
So the goal of this part here was really
157
00:09:16,600 --> 00:09:20,730
to have you practice writing this same code basically,
158
00:09:20,730 --> 00:09:24,070
or very similar code over and over again,
159
00:09:24,070 --> 00:09:25,630
'cause this is the only way
160
00:09:25,630 --> 00:09:29,163
that this stuff really gets into your brain.
161
00:09:31,850 --> 00:09:35,253
So let's call this one JavaScript code on a screen,
162
00:09:37,100 --> 00:09:42,100
and again, the width of 75, and the height of 75.
163
00:09:45,070 --> 00:09:46,700
And you notice I'm writing this
164
00:09:46,700 --> 00:09:48,973
a little bit faster right now,
165
00:09:50,770 --> 00:09:53,610
because we don't want to waste a lot of time
166
00:09:53,610 --> 00:09:55,860
writing this repetitive code.
167
00:09:55,860 --> 00:10:00,230
This was really just for you to practice, is awesome.
168
00:10:03,560 --> 00:10:04,893
Finally the paragraph,
169
00:10:08,440 --> 00:10:12,913
give it a save, and beautiful.
170
00:10:16,210 --> 00:10:18,700
So this looks just like in our demo,
171
00:10:18,700 --> 00:10:20,610
and we have now all this content
172
00:10:20,610 --> 00:10:23,920
that we want to display here nicely marked up
173
00:10:23,920 --> 00:10:26,320
in a very logical way.
174
00:10:26,320 --> 00:10:28,540
So you might be wondering why we used
175
00:10:28,540 --> 00:10:31,270
a list here in this case.
176
00:10:31,270 --> 00:10:32,520
And the reason for that
177
00:10:32,520 --> 00:10:36,000
is basically the idea behind Semantic HTML,
178
00:10:36,000 --> 00:10:38,570
that I explained a little bit earlier.
179
00:10:38,570 --> 00:10:41,250
So if we think about these related posts,
180
00:10:41,250 --> 00:10:42,790
we can very easily argue
181
00:10:42,790 --> 00:10:47,390
that it is essentially a list of related posts, right?
182
00:10:47,390 --> 00:10:51,770
And so if it is a list, we should mark it up in our HTML,
183
00:10:51,770 --> 00:10:55,630
so we should write our HTML as a list.
184
00:10:55,630 --> 00:10:58,110
And so that's just what we did.
185
00:10:58,110 --> 00:11:01,710
Later with CSS, we will then remove these bullet points,
186
00:11:01,710 --> 00:11:04,630
because they don't make a lot of sense in this context,
187
00:11:04,630 --> 00:11:07,000
but even with the bullet points removed,
188
00:11:07,000 --> 00:11:10,420
we still want a meaning of this element,
189
00:11:10,420 --> 00:11:13,870
So of all of this here to be a list.
190
00:11:13,870 --> 00:11:17,170
But anyway, that's enough for this video.
191
00:11:17,170 --> 00:11:20,670
So I really hoped that you completed this challenge,
192
00:11:20,670 --> 00:11:24,750
and that you enjoyed doing it, even if it took some time,
193
00:11:24,750 --> 00:11:27,430
and even if you had to review some concepts
194
00:11:27,430 --> 00:11:29,450
from the previous lectures.
195
00:11:29,450 --> 00:11:30,770
That's completely normal,
196
00:11:30,770 --> 00:11:34,390
and that's exactly how it should be actually.
197
00:11:34,390 --> 00:11:37,640
Now in order to practice a little bit more even,
198
00:11:37,640 --> 00:11:40,240
there is another coding challenge coming up,
199
00:11:40,240 --> 00:11:44,400
which is completely detached from this project,
200
00:11:44,400 --> 00:11:46,380
but it's a really exciting one.
201
00:11:46,380 --> 00:11:48,373
So I hope to see you there soon.
14984
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.