Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,770 --> 00:00:04,250
Let's keep working with text.
2
00:00:04,250 --> 00:00:07,400
And in this lecture, we will learn how to create lists
3
00:00:07,400 --> 00:00:10,743
with bullet points and also with numbers.
4
00:00:12,230 --> 00:00:15,330
And what I mean by list is basically
5
00:00:15,330 --> 00:00:18,930
like a list of bullet points, like we have here,
6
00:00:18,930 --> 00:00:22,300
and also like an ordered list with numbers,
7
00:00:22,300 --> 00:00:27,020
like here with 1, 2, 3 ordered elements.
8
00:00:27,020 --> 00:00:30,600
All right. So that is very easy to do in HTML.
9
00:00:30,600 --> 00:00:32,830
So let's see how.
10
00:00:32,830 --> 00:00:37,630
So starting with the numbered list, so this one here,
11
00:00:37,630 --> 00:00:42,360
it is here at the end of this section of our text.
12
00:00:42,360 --> 00:00:44,663
So in the What is HTML part.
13
00:00:45,890 --> 00:00:49,520
So we have this paragraph, then we have this paragraph,
14
00:00:49,520 --> 00:00:52,020
and then we actually have another paragraph there
15
00:00:52,020 --> 00:00:53,900
that we missed.
16
00:00:53,900 --> 00:00:55,800
And then after that, we have the list.
17
00:00:56,700 --> 00:00:59,523
So let's get all of this content.
18
00:01:00,560 --> 00:01:02,780
So these are the three list items,
19
00:01:02,780 --> 00:01:04,480
and that is the missing paragraph.
20
00:01:06,770 --> 00:01:08,310
Okay.
21
00:01:08,310 --> 00:01:10,573
Just paste all of that here.
22
00:01:11,820 --> 00:01:16,683
And now I will simply wrap this element inside of a p.
23
00:01:21,140 --> 00:01:23,163
And so there we have the paragraph.
24
00:01:24,100 --> 00:01:27,360
So we have everything nicely structured here,
25
00:01:27,360 --> 00:01:29,653
and now let's start the list.
26
00:01:30,760 --> 00:01:34,350
So the element to start a ordered list,
27
00:01:34,350 --> 00:01:37,650
which is what a list with numbers is called,
28
00:01:37,650 --> 00:01:40,500
we use the ol element.
29
00:01:40,500 --> 00:01:42,050
So like this.
30
00:01:42,050 --> 00:01:46,200
And so ol stands for ordered list.
31
00:01:46,200 --> 00:01:47,880
And we open it, so of course,
32
00:01:47,880 --> 00:01:50,093
we also need to close the element.
33
00:01:51,910 --> 00:01:53,190
Okay.
34
00:01:53,190 --> 00:01:56,360
Now let's give us some space here because actually
35
00:01:56,360 --> 00:01:59,630
for each of the elements of the list,
36
00:01:59,630 --> 00:02:04,200
we need to create an element inside of the ordered list.
37
00:02:04,200 --> 00:02:07,830
And so for that, we use the li element,
38
00:02:07,830 --> 00:02:09,713
which stands for list item.
39
00:02:10,790 --> 00:02:12,730
So list item,
40
00:02:12,730 --> 00:02:13,920
open it,
41
00:02:13,920 --> 00:02:15,933
and close it,
42
00:02:16,773 --> 00:02:19,500
and then let's grab this content.
43
00:02:19,500 --> 00:02:22,963
So the opening tag, let's cut it actually.
44
00:02:24,764 --> 00:02:25,880
Okay.
45
00:02:25,880 --> 00:02:28,400
Then I'm going to cut these two as well
46
00:02:28,400 --> 00:02:30,083
and paste them down here.
47
00:02:31,033 --> 00:02:36,033
And then simply wrap it inside some more li elements.
48
00:02:36,890 --> 00:02:40,783
So again, li stands for list item,
49
00:02:43,740 --> 00:02:46,600
while ol stands for ordered list.
50
00:02:46,600 --> 00:02:50,420
Here, I'm giving it some indentation using the tab key
51
00:02:50,420 --> 00:02:55,370
just so that they are visually all aligned as child elements
52
00:02:55,370 --> 00:02:56,763
of the ordered list.
53
00:02:59,320 --> 00:03:02,410
So maybe you noticed how I'm using the terms
54
00:03:02,410 --> 00:03:05,130
child elements and parent elements.
55
00:03:05,130 --> 00:03:08,203
So whenever we have an element inside of another,
56
00:03:09,240 --> 00:03:12,940
basically the container of another element is the parent.
57
00:03:12,940 --> 00:03:15,230
So in this case, that's the ordered list.
58
00:03:15,230 --> 00:03:18,540
And then the elements that are inside the parent
59
00:03:18,540 --> 00:03:20,233
are the child elements.
60
00:03:21,840 --> 00:03:26,170
All right, but let's go back here and reload it.
61
00:03:26,170 --> 00:03:30,510
And indeed there is our ordered list.
62
00:03:30,510 --> 00:03:31,710
Nice.
63
00:03:31,710 --> 00:03:34,850
So the Google Chrome browser understands our code
64
00:03:34,850 --> 00:03:36,950
and knows that it should render it
65
00:03:36,950 --> 00:03:39,560
as a list of ordered numbers.
66
00:03:39,560 --> 00:03:41,230
So 1, 2, 3.
67
00:03:41,230 --> 00:03:44,400
And of course, it then automatically applies these numbers
68
00:03:44,400 --> 00:03:46,910
without us having to do anything.
69
00:03:46,910 --> 00:03:49,330
And if we added another element,
70
00:03:49,330 --> 00:03:52,400
let's say we would even add it here at the beginning,
71
00:03:52,400 --> 00:03:54,813
that would then become the first element.
72
00:03:55,750 --> 00:03:56,593
Oh, sorry.
73
00:04:00,100 --> 00:04:02,970
So that would then, as I was saying,
74
00:04:02,970 --> 00:04:04,503
become the first element.
75
00:04:09,810 --> 00:04:12,150
And indeed, now we have four of them
76
00:04:12,150 --> 00:04:13,553
and this one is the first,
77
00:04:14,470 --> 00:04:17,313
but this one we don't want, let's get rid of it.
78
00:04:18,260 --> 00:04:19,880
Nice.
79
00:04:19,880 --> 00:04:22,043
So that is one of the lists.
80
00:04:23,840 --> 00:04:26,900
And then the other one is this one here in the,
81
00:04:26,900 --> 00:04:29,840
Why should you learn HTML part.
82
00:04:29,840 --> 00:04:33,460
And again, there is some other content here,
83
00:04:33,460 --> 00:04:35,770
so let's go ahead and grab all of this
84
00:04:36,810 --> 00:04:38,463
from this content file here.
85
00:04:39,670 --> 00:04:42,080
So this is the heading,
86
00:04:42,080 --> 00:04:43,503
and now we need all of this.
87
00:04:45,190 --> 00:04:46,573
Copy and paste.
88
00:04:50,900 --> 00:04:52,920
And so once again,
89
00:04:52,920 --> 00:04:55,453
I will start by wrapping these into paragraphs.
90
00:04:56,740 --> 00:04:59,890
And so maybe you are starting to see
91
00:04:59,890 --> 00:05:03,320
that we are really creating a nice and tidy structure
92
00:05:03,320 --> 00:05:06,853
where each piece of content is inside of some element.
93
00:05:09,290 --> 00:05:12,310
So we don't have like any text floating around
94
00:05:12,310 --> 00:05:17,080
just inside of the body without being in an element, right?
95
00:05:17,080 --> 00:05:21,120
We always are creating a nice structure where each element
96
00:05:21,120 --> 00:05:22,920
has a certain meaning.
97
00:05:22,920 --> 00:05:26,170
So for example, all of these are of course paragraphs,
98
00:05:26,170 --> 00:05:28,163
and that's why we use the p element.
99
00:05:29,320 --> 00:05:32,010
And this piece of content here is a list
100
00:05:32,010 --> 00:05:34,713
and that's why we use the ordered list element.
101
00:05:35,570 --> 00:05:38,390
And so that is essentially to assign some meaning
102
00:05:38,390 --> 00:05:42,290
to the content and to structure it in a logical way.
103
00:05:42,290 --> 00:05:45,870
And so this then allows web browsers to display it
104
00:05:45,870 --> 00:05:48,070
in a way that makes sense.
105
00:05:48,070 --> 00:05:50,950
But anyway, now we have this content here,
106
00:05:50,950 --> 00:05:53,550
which you want in this kind of list,
107
00:05:53,550 --> 00:05:55,800
like bullet points here.
108
00:05:55,800 --> 00:06:00,800
And so the element that we use for that is ul.
109
00:06:00,830 --> 00:06:05,333
And ul, maybe you can guess, stands for unordered list.
110
00:06:06,310 --> 00:06:09,813
All right, let's close it down here,
111
00:06:12,700 --> 00:06:13,533
ul.
112
00:06:14,500 --> 00:06:19,375
And so an ordered list with the numbers is ol,
113
00:06:19,375 --> 00:06:21,060
and the one without numbers,
114
00:06:21,060 --> 00:06:24,100
which we say is unordered because the order
115
00:06:24,100 --> 00:06:26,610
of the elements does not matter,
116
00:06:26,610 --> 00:06:31,560
so that is then called ul, which stands for unordered list.
117
00:06:31,560 --> 00:06:34,230
But then inside of the list itself,
118
00:06:34,230 --> 00:06:36,780
we still have to use the li element
119
00:06:36,780 --> 00:06:39,050
for the individual items.
120
00:06:39,050 --> 00:06:42,080
So just like before, we need to wrap all
121
00:06:42,080 --> 00:06:46,600
of these different pieces of content into an li element.
122
00:06:46,600 --> 00:06:48,710
So we already did that before,
123
00:06:48,710 --> 00:06:51,040
so I'm sure you know how to do it.
124
00:06:51,040 --> 00:06:53,670
And maybe you saw it coming that this
125
00:06:53,670 --> 00:06:57,530
is another very small coding challenge for you.
126
00:06:57,530 --> 00:07:02,020 line:15%
So pause the video now and do exactly the same thing
127
00:07:02,020 --> 00:07:03,400 line:15%
that we did up here.
128
00:07:03,400 --> 00:07:08,400 line:15%
So wrap each of these items in an actual li element.
129
00:07:08,530 --> 00:07:11,670 line:15%
and so like this, you can keep practicing writing
130
00:07:11,670 --> 00:07:13,313 line:15%
some HTML on your own.
131
00:07:15,950 --> 00:07:20,060 line:15%
Okay. So I hope that was a simple challenge.
132
00:07:20,060 --> 00:07:23,163
And so let's quickly do it here.
133
00:07:26,950 --> 00:07:27,903
All right.
134
00:07:30,510 --> 00:07:33,390
So this one here actually has multiple lines.
135
00:07:33,390 --> 00:07:35,073
So it ends here.
136
00:07:39,890 --> 00:07:43,390
And you see that the formatting here is completely wrong,
137
00:07:43,390 --> 00:07:46,460
but I'm not worrying about that because for that,
138
00:07:46,460 --> 00:07:51,290
we have the helper tool of Prettier, right?
139
00:07:51,290 --> 00:07:55,190
So Prettier takes care of all our formatting,
140
00:07:55,190 --> 00:07:58,550
but hopefully you see that without that formatting,
141
00:07:58,550 --> 00:08:01,710
this looks like a complete mess, right?
142
00:08:01,710 --> 00:08:03,333
It's very hard to understand.
143
00:08:04,250 --> 00:08:07,750
So for example, this element here is not a child element
144
00:08:07,750 --> 00:08:10,960
of p, so it should be aligned here.
145
00:08:10,960 --> 00:08:13,080
And we could do that manually, of course,
146
00:08:13,080 --> 00:08:16,350
simply by deleting this space,
147
00:08:16,350 --> 00:08:18,890
but we can also just leave it to Prettier
148
00:08:18,890 --> 00:08:20,483
once we save the file.
149
00:08:22,130 --> 00:08:22,963
Sorry.
150
00:08:26,170 --> 00:08:29,920
And here I'm missing the closing slash.
151
00:08:29,920 --> 00:08:33,930
And now, as I was saying, as I save the file,
152
00:08:33,930 --> 00:08:36,670
then Prettier does its magic
153
00:08:36,670 --> 00:08:40,810
and nicely formatted here our elements.
154
00:08:40,810 --> 00:08:45,810
Now we also have this empty paragraph here for some reason,
155
00:08:46,150 --> 00:08:49,313
so maybe I did some mistake here earlier,
156
00:08:50,430 --> 00:08:53,980
so let's just delete it and save it again.
157
00:08:53,980 --> 00:08:58,980
And now as we come here to our page, then, indeed,
158
00:08:59,170 --> 00:09:02,850
we have our nice unordered list down here.
159
00:09:02,850 --> 00:09:04,150
Great.
160
00:09:04,150 --> 00:09:09,150
So creating lists is another important part of writing HTML.
161
00:09:09,280 --> 00:09:11,060
We use this all the time.
162
00:09:11,060 --> 00:09:14,140
And so I hope that you had fun with this lecture
163
00:09:14,140 --> 00:09:17,360
because it was quite an important one.
164
00:09:17,360 --> 00:09:18,920
So before you move on,
165
00:09:18,920 --> 00:09:22,510
please make sure to review what we just did here.
166
00:09:22,510 --> 00:09:24,670
And also think a little bit about some
167
00:09:24,670 --> 00:09:26,540
of the things I said earlier,
168
00:09:26,540 --> 00:09:30,560
such as the fact that each element has a different meaning,
169
00:09:30,560 --> 00:09:34,100
and also that we need to use these elements
170
00:09:34,100 --> 00:09:36,420
to structure our content.
171
00:09:36,420 --> 00:09:39,920
So we cannot simply just dump all of our text here
172
00:09:39,920 --> 00:09:42,823
into the body text and call it a day.
173
00:09:43,680 --> 00:09:44,800
If we did that,
174
00:09:44,800 --> 00:09:47,833
there would be no structure and no logic at all.
175
00:09:49,140 --> 00:09:52,610
So I just deleted some empty paragraph here.
176
00:09:52,610 --> 00:09:54,540
I just wanted to show you what happens
177
00:09:54,540 --> 00:09:56,530
if I select all of this.
178
00:09:56,530 --> 00:09:59,950
So copy paste here, basically.
179
00:09:59,950 --> 00:10:03,440
So if I take it and just paste it down here.
180
00:10:03,440 --> 00:10:06,033
So give it a save and,
181
00:10:07,150 --> 00:10:11,510
well, you see that it's now all one big blob of text
182
00:10:11,510 --> 00:10:15,540
and HTML doesn't really care about any white space.
183
00:10:15,540 --> 00:10:18,050
So any of these line breaks here,
184
00:10:18,050 --> 00:10:20,560
they're all irrelevant to HTML.
185
00:10:20,560 --> 00:10:23,300
So if we try to load this,
186
00:10:23,300 --> 00:10:27,400
you see (laughs) that there is no structure at all.
187
00:10:27,400 --> 00:10:32,090
So everything is just one huge line of text and yeah,
188
00:10:32,090 --> 00:10:34,803
that's it, there is no structure, there is no meaning.
189
00:10:35,870 --> 00:10:38,030
There is nothing basically.
190
00:10:38,030 --> 00:10:41,840
And so I hope that this small example showed you
191
00:10:41,840 --> 00:10:46,200
the importance of basically wrapping all pieces
192
00:10:46,200 --> 00:10:49,070
of content inside of an element
193
00:10:49,070 --> 00:10:52,940
that actually gives that content some meaning, okay?
194
00:10:52,940 --> 00:10:54,910
But with that, I'm leaving you
195
00:10:54,910 --> 00:10:57,483
and I see you soon in the next video.
14191
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.