Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,410 --> 00:00:04,540
Let's now start adding some more visual styles
2
00:00:04,540 --> 00:00:06,100
to our hero section
3
00:00:07,640 --> 00:00:10,460
and let's start by styling the text.
4
00:00:10,460 --> 00:00:14,853
So, our primary heading here and our hero description.
5
00:00:17,030 --> 00:00:18,533
So just copying that,
6
00:00:20,220 --> 00:00:22,030
let's put it here,
7
00:00:22,030 --> 00:00:25,460
and for now I'm simply putting all the styles here,
8
00:00:25,460 --> 00:00:26,990
one after another.
9
00:00:26,990 --> 00:00:31,700
So first of all, let's select a font size.
10
00:00:31,700 --> 00:00:35,680
And so let's go to our list of options
11
00:00:36,660 --> 00:00:40,880
and let's try to go maybe with this 61 here.
12
00:00:40,880 --> 00:00:45,880
So 61 pixels, which remember means 6.2 REM.
13
00:00:47,210 --> 00:00:48,043
And so again,
14
00:00:48,043 --> 00:00:51,410
we will now use the REM unit to really size
15
00:00:51,410 --> 00:00:53,220
everything on our page.
16
00:00:53,220 --> 00:00:55,820
So all the length like this one here
17
00:00:55,820 --> 00:00:58,313
and all the font sizes as well.
18
00:00:59,370 --> 00:01:02,180
Okay, then let's make it bold
19
00:01:02,180 --> 00:01:05,410
by giving it a font weight of 700
20
00:01:05,410 --> 00:01:07,803
and then let's check it out here.
21
00:01:08,830 --> 00:01:10,723
And that looks huge.
22
00:01:11,630 --> 00:01:14,710
So that's probably a bit too big
23
00:01:14,710 --> 00:01:17,530
and there's also a bit too much space
24
00:01:17,530 --> 00:01:18,713
between the lines here.
25
00:01:20,760 --> 00:01:25,613
So we used 62 pixels, so let's go one down to 52.
26
00:01:28,270 --> 00:01:33,270
So 5.2 REM and then the line height, let's set it to 1.1.
27
00:01:35,890 --> 00:01:40,510
Okay, so that looks a little bit better
28
00:01:41,370 --> 00:01:46,253
and, well let's increase it actually even more to 1.05,
29
00:01:49,060 --> 00:01:51,400
and also let's make it darker.
30
00:01:51,400 --> 00:01:54,290
So we have all our texts at 5, 5, 5,
31
00:01:54,290 --> 00:01:59,290
and this one we will make 3, 3, 3, so another gray color.
32
00:01:59,880 --> 00:02:04,223
So let's add that here to our pallette, let's say.
33
00:02:06,200 --> 00:02:09,100
And yeah, and I will talk a little bit more
34
00:02:09,100 --> 00:02:12,400
about these colors a bit later on.
35
00:02:12,400 --> 00:02:14,860
So the reason why we chose them,
36
00:02:14,860 --> 00:02:17,980
and we might also experiment a little bit with other colors,
37
00:02:17,980 --> 00:02:21,913
but for now just follow what I'm doing here.
38
00:02:22,830 --> 00:02:27,233
Okay, then let's try the hero description.
39
00:02:33,120 --> 00:02:35,933
So as always changing the font size, of course,
40
00:02:36,930 --> 00:02:41,653
here, let's try to go with 20 pixels maybe, so 2 REM
41
00:02:45,691 --> 00:02:50,521
and here we can use a little bit more line height as well.
42
00:02:50,521 --> 00:02:55,521
Okay, nice, maybe a little bit more line height even,
43
00:02:57,175 --> 00:02:58,008
and then of course,
44
00:02:58,008 --> 00:03:00,560
we finally need some spacing here as well.
45
00:03:00,560 --> 00:03:02,340
So we need some spacing here.
46
00:03:02,340 --> 00:03:05,870
So after the H 1 and then some spacing here,
47
00:03:05,870 --> 00:03:09,480
after this paragraph, right.
48
00:03:09,480 --> 00:03:11,830
And remember that we're still iterating
49
00:03:11,830 --> 00:03:13,790
with our design here.
50
00:03:13,790 --> 00:03:17,440
So we're just trying out here things a little bit for now,
51
00:03:17,440 --> 00:03:19,850
because actually we don't even have yet
52
00:03:19,850 --> 00:03:22,420
a font family selected.
53
00:03:22,420 --> 00:03:25,720
Right, and so we can tweak all of this later.
54
00:03:25,720 --> 00:03:28,680
We just need a starting base here,
55
00:03:28,680 --> 00:03:31,260
from which we can then improve.
56
00:03:31,260 --> 00:03:33,920
Okay, for example,
57
00:03:33,920 --> 00:03:36,060
I can actually see here in this heading
58
00:03:36,060 --> 00:03:39,340
that we should probably decrease the letter spacing
59
00:03:39,340 --> 00:03:41,880
because this text here is very large.
60
00:03:41,880 --> 00:03:44,280
And as we learned in one of the design rules,
61
00:03:44,280 --> 00:03:46,720
many times, it then looks unnatural
62
00:03:46,720 --> 00:03:49,230
with the big spacing between the letters
63
00:03:49,230 --> 00:03:51,410
and here that is actually the case.
64
00:03:51,410 --> 00:03:54,520
So let's remove that a little bit as well.
65
00:03:54,520 --> 00:03:58,760
So let's say a half a pixel.
66
00:03:58,760 --> 00:04:01,910
So minus 0.5 pixels
67
00:04:01,910 --> 00:04:04,350
and here notice how I'm not using REM,
68
00:04:04,350 --> 00:04:08,640
and that's because this is just a very small distance here.
69
00:04:08,640 --> 00:04:11,807
And it's also distance that we don't really need
70
00:04:11,807 --> 00:04:12,930
to scale up or down.
71
00:04:12,930 --> 00:04:15,800
And so then we can simply keep using pixels
72
00:04:15,800 --> 00:04:17,133
in those situations.
73
00:04:18,550 --> 00:04:19,430
So here I said,
74
00:04:19,430 --> 00:04:22,480
I was going to increase this a little bit
75
00:04:22,480 --> 00:04:24,653
and now let's think about our spacing.
76
00:04:25,770 --> 00:04:30,730
So after the H one, let's add like 32 pixels.
77
00:04:30,730 --> 00:04:33,490
And then after the paragraph, a little bit more,
78
00:04:33,490 --> 00:04:36,780
so maybe 48 here and so that's because the heading
79
00:04:37,663 --> 00:04:40,359
and the paragraph belong kind of together.
80
00:04:40,359 --> 00:04:43,280
And then after that, we want more space between the buttons
81
00:04:43,280 --> 00:04:45,340
because they are a bit separated
82
00:04:45,340 --> 00:04:47,393
from these two text contents.
83
00:04:49,290 --> 00:04:51,423
So as I said here,
84
00:04:52,381 --> 00:04:55,830
we're going to use a margin bottom of 32 pixels.
85
00:04:55,830 --> 00:05:00,540
So a 3.2 REM, and then here, I'm going with
86
00:05:02,302 --> 00:05:07,302
4.8 REM, so 48 pixels.
87
00:05:07,710 --> 00:05:12,710
Okay, nice, so this one looks a bit more natural now
88
00:05:13,450 --> 00:05:15,630
with the decreased letter spacing
89
00:05:15,630 --> 00:05:19,450
and here we have some nice spacing going on as well.
90
00:05:19,450 --> 00:05:23,620
Now let's just quickly vertically center this content here.
91
00:05:23,620 --> 00:05:26,220
So all of this, what's in this box
92
00:05:26,220 --> 00:05:29,183
and that should be fairly easy, right?
93
00:05:30,810 --> 00:05:34,030
Because remember that we are using a grid
94
00:05:34,030 --> 00:05:36,340
and so on the grid container,
95
00:05:36,340 --> 00:05:40,600
we can simply as always use align items,
96
00:05:40,600 --> 00:05:42,313
and set it to center.
97
00:05:43,220 --> 00:05:47,300
Okay, nice, but of course,
98
00:05:47,300 --> 00:05:50,490
then we have some problem with this spacing here.
99
00:05:50,490 --> 00:05:53,210
And so let's not actually tackle all of the spacing
100
00:05:53,210 --> 00:05:55,020
in the section.
101
00:05:55,020 --> 00:05:58,500
So of course there's also no spacing here,
102
00:05:58,500 --> 00:06:00,780
kind of between the beginning of the page
103
00:06:00,780 --> 00:06:02,840
and this hero image.
104
00:06:02,840 --> 00:06:04,880
So this entire section here.
105
00:06:04,880 --> 00:06:08,421
And so let's now indeed think a bit more
106
00:06:08,421 --> 00:06:10,490
about the visual style of the section,
107
00:06:10,490 --> 00:06:12,580
which includes not only the spacing,
108
00:06:12,580 --> 00:06:14,760
but also the colors.
109
00:06:14,760 --> 00:06:18,200
So remember that we're using the startup website
110
00:06:18,200 --> 00:06:21,310
personality here and in that personality,
111
00:06:21,310 --> 00:06:25,300
it's quite common to have a very light background colors
112
00:06:25,300 --> 00:06:27,290
in some of the sections.
113
00:06:27,290 --> 00:06:29,860
So usually that is using a gray color,
114
00:06:29,860 --> 00:06:31,520
but here in this design,
115
00:06:31,520 --> 00:06:34,110
we actually also want to include some elements
116
00:06:34,110 --> 00:06:37,460
of the calm personality, remember that.
117
00:06:37,460 --> 00:06:41,690
And so I think it would be nicer to not use a gray color,
118
00:06:41,690 --> 00:06:43,630
which is a little bit colder,
119
00:06:43,630 --> 00:06:47,970
but actually use a very, very light shade or a tint,
120
00:06:47,970 --> 00:06:51,150
maybe, I don't remember which one it is,
121
00:06:51,150 --> 00:06:53,310
but basically a very light version
122
00:06:53,310 --> 00:06:55,223
of our primary orange color.
123
00:06:56,360 --> 00:06:59,880
So let's get that color here.
124
00:06:59,880 --> 00:07:02,163
So I will copy this hex coat.
125
00:07:03,080 --> 00:07:07,453
And then remember about this tool that I mentioned to you.
126
00:07:08,940 --> 00:07:13,453
Which is the tints and shades generator.
127
00:07:14,290 --> 00:07:18,990
And as always, this linker will be on my resources page.
128
00:07:18,990 --> 00:07:21,820
But the one that I like to use is this one.
129
00:07:21,820 --> 00:07:24,523
So maketintsandshades.com.
130
00:07:25,630 --> 00:07:27,270
So we just come here,
131
00:07:27,270 --> 00:07:29,057
then paste the code here
132
00:07:29,057 --> 00:07:32,280
and then simply make tints and shades.
133
00:07:32,280 --> 00:07:36,010
And so here we now get these 10 shades.
134
00:07:36,010 --> 00:07:37,620
So the darker versions
135
00:07:37,620 --> 00:07:40,020
and then all of these lighter versions.
136
00:07:40,020 --> 00:07:43,260
So it starts, basically at the color that we selected
137
00:07:43,260 --> 00:07:45,247
and goes all the way to white here,
138
00:07:45,247 --> 00:07:47,880
and here, it starts at our selected color
139
00:07:47,880 --> 00:07:51,220
and goes all the way to black, right?
140
00:07:51,220 --> 00:07:54,630
And so let's now choose this very first color here
141
00:07:54,630 --> 00:07:58,710
as our background color, just to see if that looks nice.
142
00:07:58,710 --> 00:07:59,870
So we can click here,
143
00:07:59,870 --> 00:08:01,143
that will then copy it.
144
00:08:02,710 --> 00:08:06,163
And so let's try that.
145
00:08:07,810 --> 00:08:12,770
So we want this entire hero section, right?
146
00:08:12,770 --> 00:08:14,520
So not just the hero,
147
00:08:14,520 --> 00:08:17,830
let me first put that here so that you can see
148
00:08:17,830 --> 00:08:19,703
why we don't want it just here.
149
00:08:22,530 --> 00:08:25,400
Right, so that would look quite strange
150
00:08:25,400 --> 00:08:27,300
because usually what we see,
151
00:08:27,300 --> 00:08:31,010
is that the entire section from left to right
152
00:08:31,010 --> 00:08:33,940
has the background color, right?
153
00:08:33,940 --> 00:08:37,030
And so here we have actually one more reason why we needed
154
00:08:37,030 --> 00:08:40,773
this hero container element inside of the hero section.
155
00:08:42,580 --> 00:08:45,763
So, or actually the section hero.
156
00:08:49,230 --> 00:08:54,230
So let's move that up here by hitting alt or option up,
157
00:08:55,230 --> 00:08:59,399
give it a safe and, well,
158
00:08:59,399 --> 00:09:01,160
I think that this looks quite nice.
159
00:09:01,160 --> 00:09:05,143
If we went with a darker color, like this one here,
160
00:09:06,370 --> 00:09:09,960
then I think it would look like too dark.
161
00:09:09,960 --> 00:09:13,533
So the contrast would be too high, yeah.
162
00:09:14,610 --> 00:09:17,520
So you could go with this one, but yeah,
163
00:09:17,520 --> 00:09:20,403
I honestly prefer the little bit lighter version,
164
00:09:21,480 --> 00:09:25,200
so let's just keep it like this and I will now copy it here
165
00:09:25,200 --> 00:09:29,233
and basically add it to our color palettes here.
166
00:09:31,130 --> 00:09:33,060
So for now we just have this tint,
167
00:09:33,060 --> 00:09:35,953
but probably we will have more, a bit later on.
168
00:09:38,980 --> 00:09:42,960
Okay, and now we need to add some spacing here.
169
00:09:42,960 --> 00:09:47,740
So we want space inside of this element, not outside of it.
170
00:09:47,740 --> 00:09:51,490
So in order to preserve the background color, basically.
171
00:09:51,490 --> 00:09:54,813
So when we have background color, we always use padding.
172
00:09:55,840 --> 00:09:59,850
And so top and bottom, we want a lot of space
173
00:09:59,850 --> 00:10:02,565
because this is basically now the space
174
00:10:02,565 --> 00:10:03,630
that's between sections.
175
00:10:03,630 --> 00:10:05,503
And so here we want a lot of space,
176
00:10:06,580 --> 00:10:09,880
so, well, maybe not this much,
177
00:10:09,880 --> 00:10:13,860
but 96 pixels, I think will look good.
178
00:10:13,860 --> 00:10:15,320
And this is also developer
179
00:10:15,320 --> 00:10:17,323
that we used in our other project.
180
00:10:18,350 --> 00:10:20,440
So let's go with that.
181
00:10:20,440 --> 00:10:23,780
So 9.6 REM top and bottom,
182
00:10:23,780 --> 00:10:27,830
and then on the sides for now, we need nothing.
183
00:10:27,830 --> 00:10:30,760
And then since we're talking about spacing here,
184
00:10:30,760 --> 00:10:35,190
let's add the exact same space also inside of the grid.
185
00:10:35,190 --> 00:10:38,160
So as the gap between these columns,
186
00:10:38,160 --> 00:10:41,770
so that's gap and then for consistency,
187
00:10:41,770 --> 00:10:43,993
I'm going to use the exact same value here.
188
00:10:45,700 --> 00:10:49,010
All right, yeah, beautiful.
189
00:10:49,010 --> 00:10:52,423
So this is starting to look like something, right?
190
00:10:53,500 --> 00:10:57,300
Now here we can also dial these buttons maybe
191
00:10:57,300 --> 00:11:00,573
as a next step, I think that would be a good idea.
192
00:11:03,030 --> 00:11:05,833
So that's the button class here.
193
00:11:07,790 --> 00:11:09,343
So let's just put that here.
194
00:11:12,870 --> 00:11:13,810
And actually,
195
00:11:13,810 --> 00:11:17,670
since this is a link and not an actual button element,
196
00:11:17,670 --> 00:11:21,200
we need to actually style these pseudo classes.
197
00:11:21,200 --> 00:11:26,200
So button link and button visit here at the same time,
198
00:11:29,520 --> 00:11:33,423
let's give it our primary color as a background.
199
00:11:37,550 --> 00:11:41,690
So that's where the branding of the client comes in.
200
00:11:41,690 --> 00:11:43,380
And so this is one design decision
201
00:11:43,380 --> 00:11:45,563
we don't have to take fortunately.
202
00:11:47,410 --> 00:11:51,600
Then the font size, let's put it at 2 REM.
203
00:11:51,600 --> 00:11:53,223
So 20 pixels,
204
00:11:54,720 --> 00:11:59,720
as for the text color, let's also make it white.
205
00:12:00,020 --> 00:12:05,020
So FFF, then let's take care of the padding.
206
00:12:05,360 --> 00:12:08,110
And remember, this is an inline element.
207
00:12:08,110 --> 00:12:11,010
And it's in order for the padding to work as expected,
208
00:12:11,010 --> 00:12:13,060
we need to make it an inline block,
209
00:12:13,060 --> 00:12:16,330
so that the box model applies as usual.
210
00:12:16,330 --> 00:12:17,810
So this is something that we have done
211
00:12:17,810 --> 00:12:20,173
multiple times already, right?
212
00:12:21,270 --> 00:12:24,457
And so here, I'm going to go with 16 pixels,
213
00:12:24,457 --> 00:12:28,690
top and bottom and 32 pixels.
214
00:12:28,690 --> 00:12:31,823
So 3.2 REM to the left and right.
215
00:12:32,720 --> 00:12:33,880
So once more here,
216
00:12:33,880 --> 00:12:36,470
I like to use double the size on the sides
217
00:12:36,470 --> 00:12:38,253
than on top and bottom.
218
00:12:39,230 --> 00:12:44,230
Okay and then let's experiment with some border radius here,
219
00:12:44,650 --> 00:12:48,360
maybe 15 pixels.
220
00:12:48,360 --> 00:12:53,360
And of course we are forgetting the text decoration
221
00:12:54,960 --> 00:12:57,810
and a border radius, I think looks a little bit too much.
222
00:12:58,870 --> 00:13:01,663
Now we could, of course also make it really big.
223
00:13:03,520 --> 00:13:05,853
Let's just see what that looks like.
224
00:13:07,710 --> 00:13:10,773
Let's just remove the text decoration here very quick.
225
00:13:12,250 --> 00:13:15,900
And as I said, we need to make it an inline block as well.
226
00:13:15,900 --> 00:13:18,253
So display, I like to use at the very top,
227
00:13:20,060 --> 00:13:23,823
inline block, okay.
228
00:13:25,520 --> 00:13:30,040
So here we have the completely rounded corners, right.
229
00:13:30,040 --> 00:13:33,640
But for some reason I don't really like it in this design
230
00:13:33,640 --> 00:13:36,520
and we might circle back to it a little bit later,
231
00:13:36,520 --> 00:13:41,520
but for now I just want to make them like a lot smaller.
232
00:13:42,490 --> 00:13:47,490
So let's say 9 pixels here and yeah,
233
00:13:48,400 --> 00:13:50,133
that's actually a lot better.
234
00:13:51,160 --> 00:13:54,430
Okay, now there is just one problem here,
235
00:13:54,430 --> 00:13:57,110
which is that right now, these two buttons here
236
00:13:57,110 --> 00:14:00,440
do have exactly the same color, right?
237
00:14:00,440 --> 00:14:02,770
But that is not exactly what we want
238
00:14:02,770 --> 00:14:05,200
because now both of these buttons
239
00:14:05,200 --> 00:14:08,130
are competing for the user's attention.
240
00:14:08,130 --> 00:14:11,310
However, only this one here is important
241
00:14:11,310 --> 00:14:13,760
and this one is a lot less important.
242
00:14:13,760 --> 00:14:16,450
And so we only want this one here to be orange
243
00:14:16,450 --> 00:14:21,410
and this here should be a bit more invisible, so to say.
244
00:14:21,410 --> 00:14:25,100
So the focus or the emphasis should really, really
245
00:14:25,100 --> 00:14:27,850
lie on our main call to action button
246
00:14:27,850 --> 00:14:29,520
and not on this one.
247
00:14:29,520 --> 00:14:32,250
And so here we need two different styles.
248
00:14:32,250 --> 00:14:35,495
And so what I will do is to of course,
249
00:14:35,495 --> 00:14:36,328
leave this one orange,
250
00:14:36,328 --> 00:14:38,160
and then we can make this one white,
251
00:14:38,160 --> 00:14:40,678
because with this background color here,
252
00:14:40,678 --> 00:14:42,683
that should then look quite nice.
253
00:14:44,860 --> 00:14:48,590
So let's add here what I call a modifier class.
254
00:14:48,590 --> 00:14:52,100
And once again, we have done this multiple times already,
255
00:14:52,100 --> 00:14:54,860
which is to basically define the common styles,
256
00:14:54,860 --> 00:14:56,230
in the button.
257
00:14:56,230 --> 00:14:57,790
So just in this,
258
00:14:57,790 --> 00:15:00,890
and then we can add some more specific styles
259
00:15:00,890 --> 00:15:04,200
to this button, full class,
260
00:15:04,200 --> 00:15:08,290
and then also here to this other button,
261
00:15:08,290 --> 00:15:11,263
which I'm calling button outline, okay.
262
00:15:12,990 --> 00:15:15,593
So let's see what I mean by that.
263
00:15:16,680 --> 00:15:19,233
So button full,
264
00:15:20,080 --> 00:15:23,510
and of course I could have called it also button CTA
265
00:15:23,510 --> 00:15:27,433
for call to action or really any other thing,
266
00:15:28,523 --> 00:15:30,910
but this one will have the full background color,
267
00:15:30,910 --> 00:15:33,223
and so that's why I like to call it full.
268
00:15:34,760 --> 00:15:35,593
And then again,
269
00:15:35,593 --> 00:15:40,530
we need all these different pseudo classes, right.
270
00:15:40,530 --> 00:15:44,463
And so now what is actually specific to this one here?
271
00:15:45,410 --> 00:15:48,613
Well, it is the background color, right?
272
00:15:49,760 --> 00:15:51,340
So let's put that one here
273
00:15:51,340 --> 00:15:56,113
and then let's just copy this to make it a bit easier.
274
00:15:59,990 --> 00:16:04,990
So the outline should be white.
275
00:16:08,780 --> 00:16:13,780
Okay, nice, except that we cannot see the text here.
276
00:16:15,080 --> 00:16:19,080
And so that's because the white text is also specific
277
00:16:19,080 --> 00:16:23,663
to this one and then here we want to have the darker color.
278
00:16:24,630 --> 00:16:29,090
So then we will get the default color of 5, 5, 5.
279
00:16:29,090 --> 00:16:30,960
Well, actually we don't.
280
00:16:30,960 --> 00:16:33,910
So we get this blue default link color.
281
00:16:33,910 --> 00:16:36,623
And so let's set that here, as well.
282
00:16:41,690 --> 00:16:46,163
And now let's actually worry about our hover states here.
283
00:16:47,120 --> 00:16:49,240
So this button here, when we hover it,
284
00:16:49,240 --> 00:16:51,910
we want to make it a little bit darker.
285
00:16:51,910 --> 00:16:54,950
And this other outline button here,
286
00:16:54,950 --> 00:16:57,940
we can actually give it the same background color
287
00:16:57,940 --> 00:17:01,263
as the rest of the section when it's hovered.
288
00:17:02,990 --> 00:17:07,623
Okay, so let's just copy this here.
289
00:17:10,040 --> 00:17:14,990
And so here, let's say hover and active.
290
00:17:18,750 --> 00:17:21,533
So how do we get the darker color?
291
00:17:22,980 --> 00:17:27,980
Well, we actually already generated it, so it's right here.
292
00:17:28,000 --> 00:17:30,797
And so the darker colors are these ones here.
293
00:17:30,797 --> 00:17:33,520
And so let's simply get this next one here,
294
00:17:33,520 --> 00:17:37,810
which is just a tiny bit darker, but it should be enough.
295
00:17:37,810 --> 00:17:39,063
So let's copy that.
296
00:17:40,490 --> 00:17:45,490
And yeah, here, we don't need to this
297
00:17:47,880 --> 00:17:50,313
and I'd do the same right here.
298
00:17:54,150 --> 00:17:59,150
So hover and here the background color that we want,
299
00:18:01,600 --> 00:18:03,433
is this one.
300
00:18:05,220 --> 00:18:08,823
Oh, and here we don't need this and let's see.
301
00:18:12,310 --> 00:18:14,970
Nice, so it gets darker as intended
302
00:18:15,810 --> 00:18:19,070
and here the button kind of disappears now.
303
00:18:19,070 --> 00:18:22,330
So this does actually look a little bit unnatural.
304
00:18:22,330 --> 00:18:25,700
So we should add maybe some kind of white border here
305
00:18:25,700 --> 00:18:26,893
around this button.
306
00:18:28,060 --> 00:18:32,170
And that's actually harder than it sounds like.
307
00:18:32,170 --> 00:18:33,543
So let me show it to you.
308
00:18:34,990 --> 00:18:39,990
So let's just try to add a border of 3 pixels, solid white.
309
00:18:42,760 --> 00:18:44,253
So just like this,
310
00:18:48,601 --> 00:18:50,510
and you see what happens.
311
00:18:50,510 --> 00:18:53,300
The border kind of gets added to the outside.
312
00:18:53,300 --> 00:18:54,910
And so then when we hover it,
313
00:18:54,910 --> 00:18:59,610
the entire layout jumps a little bit, right.
314
00:18:59,610 --> 00:19:04,000
Can you see that, and so of course we don't want that.
315
00:19:04,000 --> 00:19:06,960
So what we need basically is to add the border
316
00:19:06,960 --> 00:19:11,840
to the inside of the button, okay.
317
00:19:11,840 --> 00:19:12,710
And for that,
318
00:19:12,710 --> 00:19:15,870
we can use a trick that I'm going to show you now,
319
00:19:15,870 --> 00:19:18,700
which is actually not using the border property,
320
00:19:18,700 --> 00:19:20,933
but the box shadow property.
321
00:19:22,010 --> 00:19:24,170
So that sounds strange.
322
00:19:24,170 --> 00:19:25,350
So this trick,
323
00:19:25,350 --> 00:19:30,290
let me actually write it down here to add border insight.
324
00:19:33,140 --> 00:19:36,820
And so we use box shadow without any offset,
325
00:19:36,820 --> 00:19:38,610
in any direction.
326
00:19:38,610 --> 00:19:41,540
So not horizontally and not vertically.
327
00:19:41,540 --> 00:19:45,630
We also don't want it to have any blur, right.
328
00:19:45,630 --> 00:19:49,180
But we want to scale it basically by 3 pixels.
329
00:19:49,180 --> 00:19:52,370
So that's basically the same 3 pixels that we had here,
330
00:19:52,370 --> 00:19:53,273
in the border.
331
00:19:54,340 --> 00:19:58,140
And then finally, we again, simply make the color white
332
00:19:58,140 --> 00:20:01,003
just as we did here, okay.
333
00:20:01,870 --> 00:20:02,990
So like this,
334
00:20:02,990 --> 00:20:06,576
it would basically create the same effect as here.
335
00:20:06,576 --> 00:20:08,840
And so let's add the missing piece here,
336
00:20:08,840 --> 00:20:10,943
which is the inset keyword.
337
00:20:13,240 --> 00:20:15,290
So with this inset keyword,
338
00:20:15,290 --> 00:20:18,670
the shadow will basically be added to the inside
339
00:20:18,670 --> 00:20:22,320
of the element, so exactly what we want.
340
00:20:22,320 --> 00:20:25,430
And it would be helpful if we had this inset keyword
341
00:20:25,430 --> 00:20:28,820
on the border actually, but we don't.
342
00:20:28,820 --> 00:20:30,550
So we cannot do that.
343
00:20:30,550 --> 00:20:32,880
So we need to use this box shadow trick
344
00:20:32,880 --> 00:20:37,873
to basically replicate the border and then put it inset.
345
00:20:38,720 --> 00:20:39,730
And so with this,
346
00:20:39,730 --> 00:20:42,973
you see that we now achieve this nice looking in facture.
347
00:20:45,030 --> 00:20:49,450
Okay, now, right now, these hover effects here,
348
00:20:49,450 --> 00:20:52,950
they don't look really nice and really professional
349
00:20:52,950 --> 00:20:56,870
because if we were to go to a real world website
350
00:20:56,870 --> 00:20:58,950
and hover over some button,
351
00:20:58,950 --> 00:21:01,860
then we would actually see a nice animation
352
00:21:01,860 --> 00:21:04,210
from one color to the other,
353
00:21:04,210 --> 00:21:07,430
but that's not at all what we have here, right.
354
00:21:07,430 --> 00:21:10,990
Here it simply jumps basically from one color directly
355
00:21:10,990 --> 00:21:12,500
to the other one.
356
00:21:12,500 --> 00:21:15,330
And so now let me show you yet another trick
357
00:21:15,330 --> 00:21:17,440
in which we can fix that.
358
00:21:17,440 --> 00:21:21,683
So basically create a nice animation using just CSS.
359
00:21:23,660 --> 00:21:28,130
So to do that, we basically come to the element.
360
00:21:28,130 --> 00:21:31,760
So to the rule, which has the original state.
361
00:21:31,760 --> 00:21:34,610
And so that is in this case, simply this link
362
00:21:34,610 --> 00:21:36,870
and visited, right?
363
00:21:36,870 --> 00:21:39,710
So this is to state before any hover.
364
00:21:39,710 --> 00:21:43,393
And so here we can now add the transition property.
365
00:21:45,410 --> 00:21:48,740
So transition property is a property that allows us
366
00:21:48,740 --> 00:21:51,100
to do just what it says.
367
00:21:51,100 --> 00:21:55,940
So to transition between two values, using an animation.
368
00:21:55,940 --> 00:21:58,800
Then here we can specify multiple things,
369
00:21:58,800 --> 00:22:01,210
but at least we need two things.
370
00:22:01,210 --> 00:22:04,250
We need to property that we actually want to animate.
371
00:22:04,250 --> 00:22:06,730
And we need to say over how much time
372
00:22:06,730 --> 00:22:08,453
we want the animation to happen.
373
00:22:09,400 --> 00:22:10,350
Now, in this case,
374
00:22:10,350 --> 00:22:14,503
we want to animate both the background color and the color,
375
00:22:15,480 --> 00:22:18,420
right, now, in this case,
376
00:22:18,420 --> 00:22:22,550
we want to animate both the background color and the color,
377
00:22:22,550 --> 00:22:27,060
right, and so we can actually just say all.
378
00:22:27,060 --> 00:22:30,253
And so with this, all the properties will be animated.
379
00:22:31,130 --> 00:22:33,130
Okay, and then again,
380
00:22:33,130 --> 00:22:36,430
over how many times we want the animation to happen.
381
00:22:36,430 --> 00:22:39,423
And so let's just start here with 1 second.
382
00:22:40,830 --> 00:22:43,350
So here we can choose S for second,
383
00:22:43,350 --> 00:22:46,570
or we could also specify milliseconds.
384
00:22:46,570 --> 00:22:50,723
So that would be for 1 second, 1000 milliseconds,
385
00:22:51,620 --> 00:22:53,550
but I like to always use seconds.
386
00:22:53,550 --> 00:22:55,690
It's a bit more natural.
387
00:22:55,690 --> 00:22:57,971
And so let's see what happens now,
388
00:22:57,971 --> 00:23:00,430
as we hover over the button
389
00:23:01,780 --> 00:23:05,140
and you see that it nicely changed the color here,
390
00:23:05,140 --> 00:23:09,230
over one second, you see that?
391
00:23:09,230 --> 00:23:12,070
And the same is not happening here.
392
00:23:12,070 --> 00:23:14,230
Now of course, this is way too slow,
393
00:23:14,230 --> 00:23:16,603
but this was just to show you the effect.
394
00:23:17,450 --> 00:23:19,680
To make it even a bit more visible.
395
00:23:19,680 --> 00:23:23,223
Let's put the hover state to another color.
396
00:23:24,540 --> 00:23:27,903
Let's say it red, as my favorite color here.
397
00:23:29,250 --> 00:23:34,250
All right, and you see that changed over one second
398
00:23:37,091 --> 00:23:39,391
and here of course, it's still the same, okay.
399
00:23:42,400 --> 00:23:45,020
And I noticed that actually we are only changing
400
00:23:45,020 --> 00:23:47,700
the background color and not the color.
401
00:23:47,700 --> 00:23:51,393
And so here, we could also have written this.
402
00:23:52,360 --> 00:23:56,327
So instead of all, we can say, just background color, right.
403
00:23:58,050 --> 00:23:58,883
Then here,
404
00:23:58,883 --> 00:24:02,410
we could also specify a third value to change the type
405
00:24:02,410 --> 00:24:06,120
of the animation, but that is a little bit more complex.
406
00:24:06,120 --> 00:24:08,920
So I'm gonna leave that for later.
407
00:24:08,920 --> 00:24:11,580
Okay, so here, I just wanted to introduce you
408
00:24:11,580 --> 00:24:14,600
to this brand new CSS property.
409
00:24:14,600 --> 00:24:17,090
So at least brand new for you
410
00:24:17,090 --> 00:24:19,660
because it's been around for some years,
411
00:24:19,660 --> 00:24:21,900
but for you, it is a new property.
412
00:24:21,900 --> 00:24:24,650
And it is actually a really exciting one
413
00:24:24,650 --> 00:24:26,880
because it allows us to do animations
414
00:24:26,880 --> 00:24:29,470
in a very, very simple way.
415
00:24:29,470 --> 00:24:32,600
And with animation here, basically what we mean
416
00:24:32,600 --> 00:24:35,990
is to change the value of a certain property
417
00:24:35,990 --> 00:24:40,460
or of multiple properties from one value to another one.
418
00:24:40,460 --> 00:24:41,580
So in this case,
419
00:24:41,580 --> 00:24:45,560
that is from this background color to this one here.
420
00:24:45,560 --> 00:24:47,660
All right, and remember,
421
00:24:47,660 --> 00:24:51,403
we always put the transition here on the original state.
422
00:24:52,590 --> 00:24:54,790
We'll actually write that down here for you.
423
00:25:01,160 --> 00:25:06,160
So state is not really a correct CSS term, but I think,
424
00:25:06,670 --> 00:25:08,840
you know what I mean there.
425
00:25:08,840 --> 00:25:11,960
Now here one second is of course way too long.
426
00:25:11,960 --> 00:25:14,690
So let's use a better value
427
00:25:14,690 --> 00:25:18,720
and something that is commonly used is 0.3 seconds.
428
00:25:18,720 --> 00:25:20,663
So that's 300 milliseconds.
429
00:25:21,530 --> 00:25:25,830
And so it is, we have a nice and snappy animation,
430
00:25:25,830 --> 00:25:27,453
which feels quite natural.
431
00:25:28,650 --> 00:25:31,350
Beautiful, now there's just one more thing
432
00:25:31,350 --> 00:25:32,760
that we need to fix,
433
00:25:32,760 --> 00:25:36,210
which is the space here between these buttons.
434
00:25:36,210 --> 00:25:39,840
So this is of course not enough space that we have here.
435
00:25:39,840 --> 00:25:41,960
So this doesn't look natural at all
436
00:25:41,960 --> 00:25:45,333
and so we need to add some spacing here between those two.
437
00:25:46,980 --> 00:25:49,970
Now, how should we do this?
438
00:25:49,970 --> 00:25:54,500
I mean, this button full here should probably be reused
439
00:25:54,500 --> 00:25:56,990
in a later point on this side.
440
00:25:56,990 --> 00:26:00,300
And so therefore I will not simply add a margin to the right
441
00:26:00,300 --> 00:26:03,053
here in this element, right.
442
00:26:03,053 --> 00:26:06,923
I mean, of course I could do this,
443
00:26:09,550 --> 00:26:14,550
like 1.6 REM and that would then work quite nicely.
444
00:26:14,730 --> 00:26:17,350
Right, but then if I added this button here
445
00:26:17,350 --> 00:26:18,950
somewhere else on the page,
446
00:26:18,950 --> 00:26:21,557
that would also get the same margin, right.
447
00:26:21,557 --> 00:26:24,110
And so that's not what we want.
448
00:26:24,110 --> 00:26:27,390
Now another option here would to wrap these two buttons
449
00:26:27,390 --> 00:26:31,180
into some grid container or some flex container,
450
00:26:31,180 --> 00:26:35,360
and then add some gap into that one, right.
451
00:26:35,360 --> 00:26:38,210
But that seems like a bit too much work here.
452
00:26:38,210 --> 00:26:41,330
So that's also not what I want, but instead,
453
00:26:41,330 --> 00:26:45,680
what I'm going to do here is add a special helper class
454
00:26:45,680 --> 00:26:47,083
to this button here.
455
00:26:49,680 --> 00:26:50,860
So let me just write it
456
00:26:50,860 --> 00:26:52,993
and then I will explain what this is.
457
00:26:53,840 --> 00:26:57,263
So I'm going to call it margin, right,
458
00:26:58,680 --> 00:27:01,000
and SM for small.
459
00:27:01,000 --> 00:27:04,070
Okay, and so this will be like a reusable
460
00:27:04,070 --> 00:27:06,390
and very generic helper class
461
00:27:06,390 --> 00:27:08,770
that I can now define in my CSS,
462
00:27:08,770 --> 00:27:11,970
and then add to multiple elements,
463
00:27:11,970 --> 00:27:14,773
to give them some space on the right side.
464
00:27:16,270 --> 00:27:19,553
So let's say 1.6 REM, okay.
465
00:27:23,940 --> 00:27:27,330
And so now here, it looks exactly the same as before,
466
00:27:27,330 --> 00:27:30,030
but we achieved that using this technique
467
00:27:30,030 --> 00:27:35,030
of using a helper class like this, okay.
468
00:27:35,130 --> 00:27:38,050
Now, when we use a helper class like this,
469
00:27:38,050 --> 00:27:42,660
we really, really want the style that it has to be applied
470
00:27:42,660 --> 00:27:46,690
and no matter what other styles are already on the element.
471
00:27:46,690 --> 00:27:50,030
So in order to ensure that we usually then add
472
00:27:50,030 --> 00:27:53,630
the important keyword here, because remember that,
473
00:27:53,630 --> 00:27:56,540
then make sure that this style here.
474
00:27:56,540 --> 00:28:01,310
So this declaration here always has the highest priority.
475
00:28:01,310 --> 00:28:03,470
So in this case that wouldn't be necessary,
476
00:28:03,470 --> 00:28:07,740
but that's just a good practice to do, okay.
477
00:28:07,740 --> 00:28:10,920
And with experience you will of course then know
478
00:28:10,920 --> 00:28:13,330
when you should use a class like this.
479
00:28:13,330 --> 00:28:16,620
And also I will show you a couple more use cases
480
00:28:16,620 --> 00:28:18,330
throughout this project.
481
00:28:18,330 --> 00:28:21,800
But many times it is actually related to margins
482
00:28:21,800 --> 00:28:24,380
that we want to reuse in multiple places,
483
00:28:24,380 --> 00:28:28,080
but that we do not want to add to specific elements
484
00:28:28,080 --> 00:28:31,370
because then when we want to reuse them somewhere else,
485
00:28:31,370 --> 00:28:34,363
it might create some conflicts that we don't want.
486
00:28:35,200 --> 00:28:37,823
Okay, and I hope that made sense.
487
00:28:38,740 --> 00:28:40,610
And here, of course, yeah,
488
00:28:40,610 --> 00:28:42,050
we don't need to use the link
489
00:28:42,050 --> 00:28:44,130
and to visit the pseudo classes,
490
00:28:44,130 --> 00:28:48,300
because this class here is intended to use on all kinds
491
00:28:48,300 --> 00:28:50,233
of elements, not just on buttons.
492
00:28:51,260 --> 00:28:53,350
But anyway, let's go back here.
493
00:28:53,350 --> 00:28:58,120
And now this section here looks quite nice already.
494
00:28:58,120 --> 00:29:01,020
So really great work up until this point.
495
00:29:01,020 --> 00:29:04,030
It looks really, really beautiful already.
496
00:29:04,030 --> 00:29:07,770
Now, next up, we want to add the small components down here,
497
00:29:07,770 --> 00:29:11,518
which has these customer faces that I showed you
498
00:29:11,518 --> 00:29:13,340
by the start of the last lecture.
499
00:29:13,340 --> 00:29:15,910
And then I think it's also time to select
500
00:29:15,910 --> 00:29:20,200
a really nice type phase for our project, okay.
501
00:29:20,200 --> 00:29:23,010
And so we will do all of that in the next part
502
00:29:23,010 --> 00:29:24,973
of building this hero section.
37669
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.