Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,460 --> 00:00:03,550
So we already learned a couple of
2
00:00:03,550 --> 00:00:07,520
very important HTML elements and are already able
3
00:00:07,520 --> 00:00:12,400
to create a nice page with some nice functionality as well.
4
00:00:12,400 --> 00:00:15,490
But now it's time to actually add some structure
5
00:00:15,490 --> 00:00:18,400
to our document and to our elements.
6
00:00:18,400 --> 00:00:22,140
And so lets now learn a couple of new HTML five elements
7
00:00:22,140 --> 00:00:23,173
for that.
8
00:00:24,850 --> 00:00:28,550
Now, when I said that the page is lacking some structure,
9
00:00:28,550 --> 00:00:31,413
what I meant is that all of these elements
10
00:00:31,413 --> 00:00:33,920
that we placed in our document,
11
00:00:33,920 --> 00:00:38,920
they're all simply like appearing one after another here.
12
00:00:39,060 --> 00:00:39,893
Right?
13
00:00:39,893 --> 00:00:43,380
They're not really like distinguished from one another.
14
00:00:43,380 --> 00:00:44,310
And especially,
15
00:00:44,310 --> 00:00:48,550
they're not like grouped together in any logical way.
16
00:00:48,550 --> 00:00:50,650
And so let's change that by creating
17
00:00:50,650 --> 00:00:53,490
some container elements, which will then group
18
00:00:53,490 --> 00:00:54,690
these elements together.
19
00:00:55,820 --> 00:00:58,526
So one of the things that first come to mind,
20
00:00:58,526 --> 00:01:01,010
is these links here.
21
00:01:01,010 --> 00:01:02,540
So we have all of these links,
22
00:01:02,540 --> 00:01:07,080
and this kind of looks like a page navigation here, right?
23
00:01:07,080 --> 00:01:10,410
So a page navigation is usually what we want,
24
00:01:10,410 --> 00:01:14,300
when we have a couple of links at the top of a page.
25
00:01:14,300 --> 00:01:18,313
And so what we can do is to specify a special element,
26
00:01:18,313 --> 00:01:21,943
and then place all the links into that element.
27
00:01:23,170 --> 00:01:25,633
And the element that I mean is called nav.
28
00:01:27,290 --> 00:01:30,243
So nav, which stands for navigation.
29
00:01:32,550 --> 00:01:34,530
So just like this,
30
00:01:34,530 --> 00:01:37,180
and now these need to be indentated,
31
00:01:37,180 --> 00:01:39,000
or they should be at least.
32
00:01:39,000 --> 00:01:40,370
And so when I give it a safe,
33
00:01:40,370 --> 00:01:43,780
then prettier formats this automatically.
34
00:01:43,780 --> 00:01:46,760
And now these four links are nicely grouped
35
00:01:46,760 --> 00:01:48,450
into this container here.
36
00:01:48,450 --> 00:01:52,530
So into this parent element, which is a navigation.
37
00:01:52,530 --> 00:01:56,380
Now, the thing is that when we now update our page,
38
00:01:56,380 --> 00:01:59,290
it does look exactly the same.
39
00:01:59,290 --> 00:02:00,840
So all that happens here
40
00:02:00,840 --> 00:02:04,950
is that this basically created like an invisible box,
41
00:02:04,950 --> 00:02:08,440
which now contains these elements.
42
00:02:08,440 --> 00:02:12,240
Okay. So the element on itself doesn't do anything,
43
00:02:12,240 --> 00:02:15,540
All it does is to group these elements together.
44
00:02:15,540 --> 00:02:17,880
And I understand that right now,
45
00:02:17,880 --> 00:02:20,610
it doesn't really seem intuitive or logical
46
00:02:20,610 --> 00:02:22,890
to be doing this, but trust me,
47
00:02:22,890 --> 00:02:26,009
once we reach the section where we build some layouts
48
00:02:26,009 --> 00:02:30,430
and actually also in the next section, just on CSS,
49
00:02:30,430 --> 00:02:33,640
it will be very important to have all these different parts
50
00:02:33,640 --> 00:02:36,150
inside of their own containers.
51
00:02:36,150 --> 00:02:36,983
All right.
52
00:02:38,070 --> 00:02:39,823
So looking at our page,
53
00:02:39,823 --> 00:02:42,630
basically, this is now the navigation,
54
00:02:42,630 --> 00:02:45,093
and this here is the heading.
55
00:02:45,990 --> 00:02:49,140
Then after that we have all of this here,
56
00:02:49,140 --> 00:02:53,610
which is basically our post. So our blog post.
57
00:02:53,610 --> 00:02:54,670
Right?
58
00:02:54,670 --> 00:02:59,670
So this is kind of different than this top part.
59
00:02:59,700 --> 00:03:02,600
So all of this is the blog post again,
60
00:03:02,600 --> 00:03:06,700
and this is like the top part of our webpage.
61
00:03:06,700 --> 00:03:10,040
So what we can do is to group this navigation
62
00:03:10,040 --> 00:03:13,083
and the heading into a header element.
63
00:03:14,330 --> 00:03:16,910
All right. So let's do that.
64
00:03:16,910 --> 00:03:19,590
So this is another HTML five element,
65
00:03:19,590 --> 00:03:21,910
which is called header.
66
00:03:21,910 --> 00:03:23,420
And the header basically means
67
00:03:23,420 --> 00:03:26,460
the top part of a web document,
68
00:03:26,460 --> 00:03:31,030
or it can also mean the top part of some smaller unit,
69
00:03:31,030 --> 00:03:32,830
as we will actually see in a minute.
70
00:03:35,290 --> 00:03:38,060
And anyway, this is just an introduction
71
00:03:38,060 --> 00:03:40,330
to these HTML five elements.
72
00:03:40,330 --> 00:03:41,890
We will use them even more,
73
00:03:41,890 --> 00:03:43,900
and I will explain them even more
74
00:03:43,900 --> 00:03:46,600
when we build our big website project
75
00:03:46,600 --> 00:03:48,300
a little bit later in this course.
76
00:03:49,310 --> 00:03:50,550
Okay?
77
00:03:50,550 --> 00:03:53,650
So again, nothing will have changed visually,
78
00:03:53,650 --> 00:03:55,647
but now we told the browser like,
79
00:03:55,647 --> 00:03:59,400
"Hey, all of this here is our webpage header".
80
00:03:59,400 --> 00:04:03,480
So it's the top part of our page.
81
00:04:03,480 --> 00:04:05,690
Then all of this, as I mentioned before,
82
00:04:05,690 --> 00:04:09,640
starting here, is the main part of the page.
83
00:04:09,640 --> 00:04:12,280
Which is in this case, a blog post.
84
00:04:12,280 --> 00:04:16,290
And a very common element that we can use for a blog post,
85
00:04:16,290 --> 00:04:18,433
is the article element.
86
00:04:20,520 --> 00:04:24,463
So this is yet another container element,
87
00:04:25,310 --> 00:04:27,943
but this time it's one for an article.
88
00:04:28,890 --> 00:04:33,300
And article in this context actually does not simply mean
89
00:04:33,300 --> 00:04:35,410
a written article like this,
90
00:04:35,410 --> 00:04:38,830
but it can also be like things from the real world.
91
00:04:38,830 --> 00:04:42,900
Like a computer is an article or a pen or a phone.
92
00:04:42,900 --> 00:04:44,920
So all of these are articles,
93
00:04:44,920 --> 00:04:48,939
and if somehow we needed to represent a computer in HTML,
94
00:04:48,939 --> 00:04:53,423
then an article would also be a good element for that.
95
00:04:55,270 --> 00:04:56,320
Okay?
96
00:04:56,320 --> 00:04:57,913
And so now basically,
97
00:04:58,778 --> 00:05:02,470
our body has only two direct child elements.
98
00:05:02,470 --> 00:05:05,710
We only have a header and we have article.
99
00:05:05,710 --> 00:05:09,600
Which is when we look at our page, really all we have.
100
00:05:09,600 --> 00:05:12,870
So we have to header and we have all of the rest,
101
00:05:12,870 --> 00:05:14,630
which is our article.
102
00:05:14,630 --> 00:05:19,040
So that is now nicely placed inside of its own box.
103
00:05:19,040 --> 00:05:21,317
Now, one thing that you might ask,
104
00:05:21,317 --> 00:05:23,490
"Well, if these boxes,
105
00:05:23,490 --> 00:05:25,670
all of them don't do anything,
106
00:05:25,670 --> 00:05:28,710
then why don't we call all of them just nav,
107
00:05:28,710 --> 00:05:32,610
or all of them header or all of them article?"
108
00:05:32,610 --> 00:05:34,500
So this one could also be article
109
00:05:34,500 --> 00:05:36,880
and nothing would change on the page.
110
00:05:36,880 --> 00:05:38,250
Right?
111
00:05:38,250 --> 00:05:41,330
However, we don't do that for something called
112
00:05:41,330 --> 00:05:43,130
semantic HTML.
113
00:05:43,130 --> 00:05:45,520
And I will explain briefly what that means
114
00:05:45,520 --> 00:05:47,080
in the next video.
115
00:05:47,080 --> 00:05:49,520
But now continuing even further,
116
00:05:49,520 --> 00:05:51,560
we can actually do some more grouping here
117
00:05:51,560 --> 00:05:53,343
inside of our article.
118
00:05:54,260 --> 00:05:57,620
So notice how we have kind of this top part here
119
00:05:57,620 --> 00:05:59,090
of the article.
120
00:05:59,090 --> 00:06:00,600
So basically the heading,
121
00:06:00,600 --> 00:06:02,050
the author here,
122
00:06:02,050 --> 00:06:03,700
and also the image.
123
00:06:03,700 --> 00:06:06,570
So this is kind of the top part of our article.
124
00:06:06,570 --> 00:06:11,020
And then here we have the content itself, right?
125
00:06:11,020 --> 00:06:13,200
And so once again notice how I said,
126
00:06:13,200 --> 00:06:17,140
that this is like the top part of the article.
127
00:06:17,140 --> 00:06:18,340
So just like this here
128
00:06:18,340 --> 00:06:21,163
is the top part of the entire webpage.
129
00:06:22,300 --> 00:06:24,640
So what that means is that here again,
130
00:06:24,640 --> 00:06:29,640
we should use a header element to basically mark that up.
131
00:06:30,180 --> 00:06:32,350
And by marking up, I mean,
132
00:06:32,350 --> 00:06:35,423
to basically describe the content in a better way.
133
00:06:36,530 --> 00:06:39,240
So as I just said, inside of the article,
134
00:06:39,240 --> 00:06:41,563
we want to also have a header.
135
00:06:43,060 --> 00:06:44,390
So inside of that header,
136
00:06:44,390 --> 00:06:48,000
there should be this heading,
137
00:06:48,000 --> 00:06:49,670
this author image,
138
00:06:49,670 --> 00:06:52,863
the author name, and then here this image.
139
00:06:54,600 --> 00:06:57,140
Okay? And then closing it.
140
00:06:57,140 --> 00:06:58,810
Now all of this is of course,
141
00:06:58,810 --> 00:07:00,793
a little bit subjective as well.
142
00:07:01,800 --> 00:07:04,500
So what seems very logical here to me,
143
00:07:04,500 --> 00:07:07,930
might not be as logical for other developers.
144
00:07:07,930 --> 00:07:10,690
But, I think that what we just did here,
145
00:07:10,690 --> 00:07:11,957
up until this point,
146
00:07:11,957 --> 00:07:15,283
is quite logical for everyone and makes sense.
147
00:07:16,480 --> 00:07:20,060
So again, this one here is the header part of the article,
148
00:07:20,060 --> 00:07:22,470
and with this we gave our article
149
00:07:22,470 --> 00:07:24,103
a little bit more structure.
150
00:07:25,110 --> 00:07:28,050
So we have the header and only after that,
151
00:07:28,050 --> 00:07:30,553
then comes the rest of the content.
152
00:07:32,260 --> 00:07:35,543
Okay? So this is looking quite nice already,
153
00:07:37,230 --> 00:07:39,940
but finally, if we look at our demo here,
154
00:07:39,940 --> 00:07:41,693
there's actually one thing missing.
155
00:07:42,690 --> 00:07:45,080
And in fact, there's multiple things.
156
00:07:45,080 --> 00:07:48,070
So we don't have these related posts yet,
157
00:07:48,070 --> 00:07:50,220
but we will take care of that later.
158
00:07:50,220 --> 00:07:53,710
But we also have this part here at the bottom.
159
00:07:53,710 --> 00:07:56,230
So it's this copyright notice here.
160
00:07:56,230 --> 00:07:59,070
And this kind of content that comes at the very end
161
00:07:59,070 --> 00:08:02,980
of a page is what we usually call the footer.
162
00:08:02,980 --> 00:08:06,370
And so there's actually, as you might've guessed
163
00:08:06,370 --> 00:08:10,153
a special element for that as well in HTML five.
164
00:08:11,390 --> 00:08:13,183
So, footer,
165
00:08:15,020 --> 00:08:17,263
and then let's close it also,
166
00:08:18,640 --> 00:08:20,016
like this.
167
00:08:20,016 --> 00:08:22,643
And now let's grab actually the text from here.
168
00:08:26,050 --> 00:08:27,010
Actually, it's not here.
169
00:08:27,010 --> 00:08:28,883
So we have to just write it manually.
170
00:08:29,800 --> 00:08:31,820
And now here we have two options.
171
00:08:31,820 --> 00:08:35,690
So to write this text, we could create a paragraph
172
00:08:35,690 --> 00:08:37,820
and then put that text in there.
173
00:08:37,820 --> 00:08:41,350
Or we can actually also write the text right here
174
00:08:41,350 --> 00:08:42,820
into this footer.
175
00:08:42,820 --> 00:08:46,243
Okay? And this is in fact what I will do now.
176
00:08:47,250 --> 00:08:50,540
So in this case, there is just no need here to create
177
00:08:50,540 --> 00:08:52,060
yet another paragraph,
178
00:08:52,060 --> 00:08:54,210
because it's going to be the only child
179
00:08:54,210 --> 00:08:56,480
of this footer element here anyway.
180
00:08:56,480 --> 00:08:58,760
And so there's no need to then.
181
00:08:58,760 --> 00:09:00,500
So copyright,
182
00:09:00,500 --> 00:09:03,400
and now here you see this copyright symbol,
183
00:09:03,400 --> 00:09:04,653
which I'm sure you know.
184
00:09:05,530 --> 00:09:07,680
So how do we create that?
185
00:09:07,680 --> 00:09:11,330
Well, this is something called an HTML entity.
186
00:09:11,330 --> 00:09:13,260
So actually this is something new.
187
00:09:13,260 --> 00:09:15,540
So let me show you quickly how we do that.
188
00:09:15,540 --> 00:09:18,670
So we write an ampersand like this,
189
00:09:18,670 --> 00:09:19,920
and then in this case,
190
00:09:19,920 --> 00:09:23,530
I already know what the name of the character that I want.
191
00:09:23,530 --> 00:09:26,800
So I can just start writing "copy".
192
00:09:26,800 --> 00:09:29,130
And so then I can select this one here,
193
00:09:29,130 --> 00:09:32,873
or I can just write the semi-colon and then we're done.
194
00:09:34,090 --> 00:09:39,090
So this HTML entity here is what represents this, "C" here.
195
00:09:39,740 --> 00:09:44,500
Okay? And there entire tables for HTML entities.
196
00:09:44,500 --> 00:09:47,180
And I have one on my resources page.
197
00:09:47,180 --> 00:09:50,710
I think I haven't mentioned that resources page yet.
198
00:09:50,710 --> 00:09:53,620
But there is a link to it in the very first text lecture
199
00:09:53,620 --> 00:09:55,080
in the first section,
200
00:09:55,080 --> 00:09:59,050
and also in the GitHub repository that I showed you
201
00:09:59,050 --> 00:10:00,890
in one of the first lectures.
202
00:10:00,890 --> 00:10:03,130
And there, you will find a link to a page,
203
00:10:03,130 --> 00:10:05,803
which contains all of these HTML entities.
204
00:10:06,660 --> 00:10:09,600
But anyway, we will talk a little bit more about this
205
00:10:09,600 --> 00:10:11,043
later in the course, anyway.
206
00:10:12,460 --> 00:10:14,113
The code Magazine.
207
00:10:15,783 --> 00:10:16,616
Okay.
208
00:10:16,616 --> 00:10:19,033
So written in the future,
209
00:10:20,520 --> 00:10:22,050
give it a safe,
210
00:10:22,050 --> 00:10:25,500
And once again, let's reload,
211
00:10:25,500 --> 00:10:27,850
and as we were expecting,
212
00:10:27,850 --> 00:10:29,430
the visual aspect of the page
213
00:10:29,430 --> 00:10:33,030
is still the same as they mentioned at the beginning.
214
00:10:33,030 --> 00:10:36,690
So these again are just important to group the content into
215
00:10:36,690 --> 00:10:38,120
logical parts,
216
00:10:38,120 --> 00:10:40,960
which is important for semantic HTML,
217
00:10:40,960 --> 00:10:43,130
and also for styling with CSS,
218
00:10:43,130 --> 00:10:45,890
as you will see in the next section.
219
00:10:45,890 --> 00:10:48,374
And speaking of semantic HTML,
220
00:10:48,374 --> 00:10:51,930
that is going to be the topic of our next video.
221
00:10:51,930 --> 00:10:53,973
So I hope to see you there very soon.
15954
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.