Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,180 --> 00:00:02,380
In this video,
2
00:00:02,380 --> 00:00:06,023
we're gonna build the navigation for our webpage.
3
00:00:07,590 --> 00:00:09,600
And we're gonna do that right here
4
00:00:09,600 --> 00:00:11,773
inside of this NAV element.
5
00:00:12,650 --> 00:00:14,680
Now in our very first project,
6
00:00:14,680 --> 00:00:17,400
way back at the beginning of the course,
7
00:00:17,400 --> 00:00:19,800
we simply put a bunch of links,
8
00:00:19,800 --> 00:00:23,830
so a bunch of anchor elements right into this NAV.
9
00:00:23,830 --> 00:00:27,010
However, that is not the most semantic way
10
00:00:27,010 --> 00:00:29,160
of building a navigation,
11
00:00:29,160 --> 00:00:31,960
because a navigation should basically be
12
00:00:31,960 --> 00:00:35,170
a list of links grouped together.
13
00:00:35,170 --> 00:00:37,400
And so what we should do really
14
00:00:37,400 --> 00:00:40,140
is to create an unordered list.
15
00:00:40,140 --> 00:00:42,400
And then inside of that list
16
00:00:42,400 --> 00:00:45,040
is where we're gonna add all our links
17
00:00:45,040 --> 00:00:46,463
to the anchor elements.
18
00:00:47,870 --> 00:00:51,139
So we're going to use the UL element
19
00:00:51,139 --> 00:00:56,020
and let's call it the main NAV list.
20
00:00:58,220 --> 00:00:59,190
Okay?
21
00:00:59,190 --> 00:01:01,188
And so this is basically how everyone
22
00:01:01,188 --> 00:01:03,590
does their navigations.
23
00:01:03,590 --> 00:01:05,390
So they have a NAV element,
24
00:01:05,390 --> 00:01:07,240
then a UL element,
25
00:01:07,240 --> 00:01:10,870
then in there a bunch of LI elements.
26
00:01:10,870 --> 00:01:12,770
And for each of them,
27
00:01:12,770 --> 00:01:16,150
or a better inside of each of them,
28
00:01:16,150 --> 00:01:17,783
we will have an anchor element.
29
00:01:18,890 --> 00:01:23,670
So for now these Hrefs are going to point nowhere.
30
00:01:23,670 --> 00:01:25,570
And also we don't know yet
31
00:01:25,570 --> 00:01:29,400
where we want each of these links to point to.
32
00:01:29,400 --> 00:01:32,500
So later we will want these links to lead
33
00:01:32,500 --> 00:01:35,420
to a different section of the page.
34
00:01:35,420 --> 00:01:37,640
And also, we don't know yet
35
00:01:37,640 --> 00:01:41,050
where we want each of these links to go to.
36
00:01:41,050 --> 00:01:43,760
I mean, later on we want each of these links
37
00:01:43,760 --> 00:01:45,880
to lead to a different section
38
00:01:45,880 --> 00:01:47,640
once the user clicks them,
39
00:01:47,640 --> 00:01:50,293
but we don't know yet what sections those are.
40
00:01:51,250 --> 00:01:55,230
So I'm just gonna write section one here for now.
41
00:01:55,230 --> 00:01:56,440
Okay?
42
00:01:56,440 --> 00:01:59,720
Not giving them any class just yet.
43
00:01:59,720 --> 00:02:02,420
I will do that a bit later once we actually need them.
44
00:02:03,650 --> 00:02:05,580
So let's just do five of them.
45
00:02:05,580 --> 00:02:07,523
And then we will see as we go,
46
00:02:09,280 --> 00:02:12,443
what is actually the correct number of links that we want.
47
00:02:13,730 --> 00:02:15,940
Okay? Just checking it out.
48
00:02:15,940 --> 00:02:19,183
But of course it will not be as we want it.
49
00:02:20,060 --> 00:02:22,670
So we need to get rid of the bullet points
50
00:02:22,670 --> 00:02:24,913
and we want them to be side by side.
51
00:02:27,640 --> 00:02:30,773
So that is the main NAV list.
52
00:02:37,340 --> 00:02:42,193
So let's add here another block for the navigation,
53
00:02:43,630 --> 00:02:46,080
because here we will actually need a lot of code.
54
00:02:49,940 --> 00:02:53,033
So list style should be none.
55
00:02:54,000 --> 00:02:58,110
And also we want the elements to be side by side.
56
00:02:58,110 --> 00:03:00,780
Display flex, right?
57
00:03:00,780 --> 00:03:02,220
So as always,
58
00:03:02,220 --> 00:03:04,120
or at least as many times
59
00:03:04,120 --> 00:03:07,433
we reach one more times for flex box here.
60
00:03:08,400 --> 00:03:11,630
Okay? And let's also add some gap here.
61
00:03:11,630 --> 00:03:16,290
Let's say 3.2 REM for now,
62
00:03:16,290 --> 00:03:18,940
just to have something to work with.
63
00:03:18,940 --> 00:03:22,770
And now it's time to actually style the links themselves.
64
00:03:22,770 --> 00:03:25,230
So not really DLI elements.
65
00:03:25,230 --> 00:03:28,340
So there's not really a need to style those
66
00:03:28,340 --> 00:03:30,380
because we already created
67
00:03:30,380 --> 00:03:33,180
the space between them using the gap property
68
00:03:33,180 --> 00:03:35,800
here on the flex container.
69
00:03:35,800 --> 00:03:37,230
So without flex box,
70
00:03:37,230 --> 00:03:40,990
we would now need some space between the link elements
71
00:03:40,990 --> 00:03:43,960
and then we would use margin on each of them.
72
00:03:43,960 --> 00:03:46,313
But again, now we don't need that.
73
00:03:47,760 --> 00:03:50,343
So I'm just going to style the anchors themselves.
74
00:03:51,370 --> 00:03:55,800
So main NAV link.
75
00:03:55,800 --> 00:03:59,043
And let's add that to all of them.
76
00:04:06,230 --> 00:04:07,063
Okay?
77
00:04:07,063 --> 00:04:08,573
Also copying the class name.
78
00:04:10,350 --> 00:04:11,880
And here, again,
79
00:04:11,880 --> 00:04:16,880
styling both link and the visited pseudo classes for now.
80
00:04:20,550 --> 00:04:23,623
So as always removing the text decoration.
81
00:04:26,320 --> 00:04:29,823
I'm also going to want to give them this darker color here.
82
00:04:33,040 --> 00:04:36,780
Let's make them a bit bold, but only like 500.
83
00:04:36,780 --> 00:04:41,480
Not super bold because that then gives them too much focus.
84
00:04:41,480 --> 00:04:43,370
And also let's use again,
85
00:04:43,370 --> 00:04:46,730
the font size of not 20 pixels,
86
00:04:46,730 --> 00:04:49,360
because that is reserved for the paragraph.
87
00:04:49,360 --> 00:04:53,323
But one step down at 1.8 REM.
88
00:04:54,540 --> 00:04:58,000
Or 1.8, right?
89
00:04:58,000 --> 00:05:01,870
So again, this one here is that 20 REM or at 20 pixels.
90
00:05:01,870 --> 00:05:03,990
And this one is at 1.8.
91
00:05:03,990 --> 00:05:05,213
And so is this one.
92
00:05:07,010 --> 00:05:07,990
Okay?
93
00:05:07,990 --> 00:05:11,883
Now let's change their color here once we hover them.
94
00:05:12,970 --> 00:05:15,230
So we could use some other gray color,
95
00:05:15,230 --> 00:05:16,690
maybe a lighter gray,
96
00:05:16,690 --> 00:05:18,400
or even a darker one.
97
00:05:18,400 --> 00:05:21,840
But what I want actually is a,
98
00:05:21,840 --> 00:05:23,053
is this orange color.
99
00:05:23,890 --> 00:05:25,800
And I'm going to use exactly the same one
100
00:05:25,800 --> 00:05:30,360
as this one because of the color contrast issue.
101
00:05:30,360 --> 00:05:32,660
So not this primary color,
102
00:05:32,660 --> 00:05:35,270
but actually this a bit darker one.
103
00:05:35,270 --> 00:05:36,140
Okay?
104
00:05:36,140 --> 00:05:40,850
And also of course we want that to happen with a transition.
105
00:05:40,850 --> 00:05:43,870
And so let's actually already add that here.
106
00:05:43,870 --> 00:05:46,700
So remember we used the transition property
107
00:05:46,700 --> 00:05:48,480
in order to create animations
108
00:05:48,480 --> 00:05:51,833
between different values for a certain property.
109
00:05:52,880 --> 00:05:55,693
And here I will now start using just all.
110
00:05:56,680 --> 00:05:59,980
And then again, 0.3 second.
111
00:05:59,980 --> 00:06:02,350
And so this will then animate all the values
112
00:06:02,350 --> 00:06:04,330
for all properties.
113
00:06:04,330 --> 00:06:06,397
And again, this one we need to put
114
00:06:06,397 --> 00:06:08,960
basically on the original state,
115
00:06:08,960 --> 00:06:11,263
which is just link, right?
116
00:06:12,350 --> 00:06:14,340
Let's grab this here
117
00:06:14,340 --> 00:06:16,120
so that we can work on the hover
118
00:06:16,120 --> 00:06:17,933
and active states.
119
00:06:22,160 --> 00:06:26,653
And here, as I said, I want to use this darker version.
120
00:06:28,980 --> 00:06:29,813
Okay?
121
00:06:31,760 --> 00:06:34,370
Yep, this looks quite nice.
122
00:06:34,370 --> 00:06:36,740
But now there's something that I want to do,
123
00:06:36,740 --> 00:06:38,440
which is also quite common
124
00:06:38,440 --> 00:06:40,810
in website navigations like this,
125
00:06:40,810 --> 00:06:43,226
which is to actually have a call to action
126
00:06:43,226 --> 00:06:46,910
as the very last item in the navigation.
127
00:06:46,910 --> 00:06:49,498
So basically we will want to have a,
128
00:06:49,498 --> 00:06:51,510
something like a button here,
129
00:06:51,510 --> 00:06:53,630
which is similar to this one
130
00:06:53,630 --> 00:06:55,550
and which is probably going to lead
131
00:06:55,550 --> 00:06:58,500
to the same place on our website.
132
00:06:58,500 --> 00:07:01,163
So basically repeating the same call to action
133
00:07:01,163 --> 00:07:03,940
here and here.
134
00:07:03,940 --> 00:07:07,360
So that is something quite common, as I said before.
135
00:07:07,360 --> 00:07:09,930
And so let's do that.
136
00:07:09,930 --> 00:07:12,820
So basically we need to style this last one here
137
00:07:12,820 --> 00:07:14,350
a bit differently.
138
00:07:14,350 --> 00:07:17,093
And so let me add another class here.
139
00:07:19,700 --> 00:07:20,840
Okay?
140
00:07:20,840 --> 00:07:22,950
Now we could have selected this one, of course,
141
00:07:22,950 --> 00:07:25,560
using the LS child pseudo class,
142
00:07:25,560 --> 00:07:27,950
but I actually need to style this here
143
00:07:27,950 --> 00:07:29,730
in many different places.
144
00:07:29,730 --> 00:07:33,249
And so, I mean, multiple times here in the CSS.
145
00:07:33,249 --> 00:07:38,249
And so that would be a bit cumbersome doing it like that.
146
00:07:38,560 --> 00:07:40,790
So I'm just going to leave it like this.
147
00:07:40,790 --> 00:07:42,340
And so what I want to do now
148
00:07:42,340 --> 00:07:47,340
is to add new styles to just this element.
149
00:07:49,720 --> 00:07:54,333
And in particular, I want it to look similar to the button.
150
00:07:55,720 --> 00:07:57,060
Okay?
151
00:07:57,060 --> 00:08:00,123
So basically this one here.
152
00:08:01,210 --> 00:08:03,210
So maybe not the font weight,
153
00:08:03,210 --> 00:08:04,640
not the font size,
154
00:08:04,640 --> 00:08:08,063
but the border radius and the padding.
155
00:08:08,920 --> 00:08:11,633
Probably even the padding should be smaller,
156
00:08:12,510 --> 00:08:13,913
but let's see.
157
00:08:15,410 --> 00:08:17,007
So where's that?
158
00:08:19,930 --> 00:08:22,570
And as always we also need the link
159
00:08:23,530 --> 00:08:27,173
and visited pseudo classes right here.
160
00:08:28,631 --> 00:08:29,464
Okay?
161
00:08:30,653 --> 00:08:33,233
Now here we also want the text color to be white.
162
00:08:36,650 --> 00:08:39,270
And in order for this padding here to apply,
163
00:08:39,270 --> 00:08:41,633
it should be an inline block.
164
00:08:45,430 --> 00:08:48,863
And actually let's add that to all of them.
165
00:08:49,880 --> 00:08:51,513
So right here.
166
00:08:52,840 --> 00:08:55,010
So for links, that's just a good practice
167
00:08:55,010 --> 00:08:58,930
because many times we're adding some padding there.
168
00:08:58,930 --> 00:09:01,060
And so usually I have to have it
169
00:09:01,060 --> 00:09:04,310
of always setting these links in a navigation
170
00:09:04,310 --> 00:09:05,960
to an inline block.
171
00:09:05,960 --> 00:09:07,140
Okay?
172
00:09:07,140 --> 00:09:08,918
Let's check that out.
173
00:09:08,918 --> 00:09:13,460
And as you see, the background color is not applying.
174
00:09:13,460 --> 00:09:15,130
And so this is something that we observed
175
00:09:15,130 --> 00:09:17,220
before actually already.
176
00:09:17,220 --> 00:09:20,003
So let me inspect this here and show you.
177
00:09:26,108 --> 00:09:29,120
So we should have somewhere the style
178
00:09:29,120 --> 00:09:31,200
with a different background color.
179
00:09:31,200 --> 00:09:32,650
Well, actually it's not here.
180
00:09:33,830 --> 00:09:37,570
So yeah, actually I didn't even write the code.
181
00:09:37,570 --> 00:09:39,900
So that's why it doesn't have
182
00:09:39,900 --> 00:09:41,450
the different background color.
183
00:09:42,760 --> 00:09:46,963
So background color, and it's this one.
184
00:09:48,330 --> 00:09:50,220
So let's see now.
185
00:09:50,220 --> 00:09:53,140
And actually that does work quite nice.
186
00:09:53,140 --> 00:09:56,100
Just the padding is way too big here.
187
00:09:56,100 --> 00:09:59,250
And also we now have to vertically
188
00:09:59,250 --> 00:10:01,550
align all of these items here
189
00:10:01,550 --> 00:10:06,550
because well, this is of course not what we like to see.
190
00:10:07,830 --> 00:10:12,320
So that's right here in the main NAV list,
191
00:10:12,320 --> 00:10:13,813
which has the flex container.
192
00:10:14,910 --> 00:10:16,550
So as you already know here,
193
00:10:16,550 --> 00:10:18,786
we just use align item center
194
00:10:18,786 --> 00:10:23,273
and then let's dramatically reduce the padding here.
195
00:10:24,920 --> 00:10:26,190
Let's say...
196
00:10:28,760 --> 00:10:31,090
So again, usually you have the system here
197
00:10:31,090 --> 00:10:32,950
somewhere where you don't have to
198
00:10:32,950 --> 00:10:34,823
scroll up and down all the time.
199
00:10:36,030 --> 00:10:40,150
But anyway, I'm going to use a 24 and then half.
200
00:10:40,150 --> 00:10:40,983
So 12.
201
00:10:43,270 --> 00:10:46,040
So 1.2
202
00:10:47,599 --> 00:10:49,203
and 2.4.
203
00:10:50,210 --> 00:10:51,060
Okay?
204
00:10:51,060 --> 00:10:53,860
And now just to make sure that this always applies,
205
00:10:53,860 --> 00:10:56,030
I'm going to use that end selector
206
00:10:56,030 --> 00:10:57,980
that I showed you before at some point.
207
00:10:58,830 --> 00:11:01,433
So basically we want this here to apply
208
00:11:01,433 --> 00:11:05,220
when both the NAV CTA class is there
209
00:11:05,220 --> 00:11:07,603
and the main NAV link as well.
210
00:11:08,960 --> 00:11:11,180
So we can copy this one here
211
00:11:13,240 --> 00:11:15,230
and paste it here like this.
212
00:11:15,230 --> 00:11:18,380
And so without any space, because like this,
213
00:11:18,380 --> 00:11:20,970
it would be the descendant selector,
214
00:11:20,970 --> 00:11:23,670
but like this, it means that it has to have
215
00:11:23,670 --> 00:11:26,130
both the main NAV link class
216
00:11:26,130 --> 00:11:28,423
and the NAV CTA class.
217
00:11:29,276 --> 00:11:30,530
Okay?
218
00:11:30,530 --> 00:11:32,300
And then once we do this,
219
00:11:32,300 --> 00:11:34,890
this so-called specificity, as you see here,
220
00:11:34,890 --> 00:11:38,347
is now three and this other style here
221
00:11:38,347 --> 00:11:41,070
is just zero to zero.
222
00:11:41,070 --> 00:11:43,300
And so now we can make sure
223
00:11:43,300 --> 00:11:45,203
that this here will always apply.
224
00:11:46,090 --> 00:11:46,923
Okay?
225
00:11:50,070 --> 00:11:54,883
Now let's finally just add the hover states here as well.
226
00:11:56,670 --> 00:12:00,853
Hover and active.
227
00:12:02,320 --> 00:12:03,610
And so here, we simply want to make
228
00:12:03,610 --> 00:12:05,440
the background color darker,
229
00:12:05,440 --> 00:12:08,253
just like in our main call to action button.
230
00:12:09,910 --> 00:12:10,743
Okay?
231
00:12:10,743 --> 00:12:14,200
And here we do not have to add the transition here
232
00:12:14,200 --> 00:12:16,540
because it is already right here
233
00:12:16,540 --> 00:12:18,080
in this main NAV link,
234
00:12:18,080 --> 00:12:22,113
which of course is also applying to this link right here.
235
00:12:23,040 --> 00:12:23,873
Right?
236
00:12:23,873 --> 00:12:26,460
So of course, all of this is now applying
237
00:12:26,460 --> 00:12:28,770
to the NAV CTA because,
238
00:12:28,770 --> 00:12:32,690
well, it also has that class right here.
239
00:12:32,690 --> 00:12:36,853
So this code is applying and also this one here.
240
00:12:38,520 --> 00:12:39,353
Okay?
241
00:12:39,353 --> 00:12:42,640
So we have just one conflict, which is with the color.
242
00:12:42,640 --> 00:12:45,540
And so that is the one that is being resolved now,
243
00:12:45,540 --> 00:12:49,460
because here we have these three as the specificity,
244
00:12:49,460 --> 00:12:51,003
and here we have two.
245
00:12:52,110 --> 00:12:52,943
Okay?
246
00:12:52,943 --> 00:12:56,620
So again, that's the reason why we added this part here
247
00:12:56,620 --> 00:12:57,983
to this selector.
248
00:12:59,320 --> 00:13:00,720
Okay?
249
00:13:00,720 --> 00:13:03,523
And yeah, there we go.
250
00:13:04,650 --> 00:13:07,930
Working perfectly, all of them.
251
00:13:07,930 --> 00:13:09,303
And so, yeah.
252
00:13:10,180 --> 00:13:11,270
Great.
253
00:13:11,270 --> 00:13:13,968
Now this text here of course is not ideal,
254
00:13:13,968 --> 00:13:16,900
but we are just building the site here.
255
00:13:16,900 --> 00:13:20,820
And so we will change this later as we go.
256
00:13:20,820 --> 00:13:22,110
Okay?
257
00:13:22,110 --> 00:13:23,420
So this looks perfect.
258
00:13:23,420 --> 00:13:25,010
I'm just going back here
259
00:13:25,010 --> 00:13:27,710
because we already have some more design values
260
00:13:27,710 --> 00:13:29,470
that I want to update.
261
00:13:29,470 --> 00:13:31,640
So here we have this border radius,
262
00:13:31,640 --> 00:13:35,360
which again, I'm using pixels here and not REM,
263
00:13:35,360 --> 00:13:36,590
because this is something
264
00:13:36,590 --> 00:13:39,710
that I do not want to scale up or down.
265
00:13:39,710 --> 00:13:41,895
So it's just a really small value.
266
00:13:41,895 --> 00:13:45,233
And I want to always keep that.
267
00:13:46,493 --> 00:13:49,400
Anyway, here we have border radius.
268
00:13:49,400 --> 00:13:52,320
And so let's put here that we use
269
00:13:54,380 --> 00:13:57,400
by default, nine pixels.
270
00:13:57,400 --> 00:14:00,190
Oh, shadows, we don't have yet.
271
00:14:00,190 --> 00:14:03,150
We also have some more font weights.
272
00:14:03,150 --> 00:14:08,150
So we actually now have also 500, 600 and even 700.
273
00:14:10,520 --> 00:14:12,513
So this one I'm calling it bold.
274
00:14:15,260 --> 00:14:19,923
This one, medium and semi-bold.
275
00:14:21,570 --> 00:14:22,403
Okay?
276
00:14:22,403 --> 00:14:26,710
I think we also have some 1.05
277
00:14:28,570 --> 00:14:31,633
and we have some 1.6, I believe.
278
00:14:33,158 --> 00:14:35,210
So I'm keeping track of that.
279
00:14:35,210 --> 00:14:36,877
Yeah, so at 1.05..
280
00:14:39,441 --> 00:14:44,441
And there is that paragraph for the description.
281
00:14:44,730 --> 00:14:45,630
Yeah, here.
282
00:14:45,630 --> 00:14:46,933
So here we used 1.6.
283
00:14:47,870 --> 00:14:50,194
And so I'm keeping track of that up here
284
00:14:50,194 --> 00:14:52,890
in this comment here,
285
00:14:52,890 --> 00:14:56,990
So that later as our file and as our CSS code grows,
286
00:14:56,990 --> 00:14:59,440
we don't end up using different values here
287
00:14:59,440 --> 00:15:02,570
and make the design inconsistent.
288
00:15:02,570 --> 00:15:04,181
Actually let me call this one here,
289
00:15:04,181 --> 00:15:09,181
like, paragraph default or something.
290
00:15:09,430 --> 00:15:11,230
And then this one is the default.
291
00:15:11,230 --> 00:15:13,793
Yeah, this one, I'm just calling it a small.
292
00:15:14,702 --> 00:15:15,630
Okay?
293
00:15:15,630 --> 00:15:18,030
So this is not really that important, the names.
294
00:15:21,230 --> 00:15:22,063
But, yeah.
295
00:15:22,063 --> 00:15:24,460
Just keeping track of these different design decisions
296
00:15:24,460 --> 00:15:26,950
that we have been taken.
297
00:15:26,950 --> 00:15:30,100
Yeah, just to ensure a consistent design
298
00:15:30,100 --> 00:15:31,853
across the entire page.
299
00:15:32,750 --> 00:15:33,790
Okay?
300
00:15:33,790 --> 00:15:37,610
And with that, we kind of finished this entire part here.
301
00:15:37,610 --> 00:15:39,280
I think it looks beautiful
302
00:15:39,280 --> 00:15:41,910
and I hope you think the same
303
00:15:41,910 --> 00:15:45,060
and that you're having a lot of fun up until this point
304
00:15:45,060 --> 00:15:47,060
in this project.
305
00:15:47,060 --> 00:15:49,880
And of course it will keep being amazing.
306
00:15:49,880 --> 00:15:53,483
And so let's now move on to the next lecture.
20875
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.