Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,600 --> 00:00:05,280
I think this lesson is one of the most important lessons in the entire course.
2
00:00:05,340 --> 00:00:10,530
And then if you understand this lesson then all the upcoming lessons will be just building on this one
3
00:00:11,340 --> 00:00:18,580
because this lesson talks about the core CSSA flex box which is understanding main and Cross access
4
00:00:18,660 --> 00:00:19,860
fluxbox.
5
00:00:19,890 --> 00:00:32,470
So let's begin.
6
00:00:32,940 --> 00:00:33,890
All right.
7
00:00:33,970 --> 00:00:41,850
So in the previous lesson when we defined the flex container by giving it display flex you notice that
8
00:00:41,850 --> 00:00:45,610
the flex elements were displayed side by side horizontally.
9
00:00:45,810 --> 00:00:49,560
You might be wondering why horizontally and why not.
10
00:00:49,560 --> 00:00:51,340
For example vertically.
11
00:00:51,660 --> 00:00:53,330
Well there's a good reason.
12
00:00:53,520 --> 00:01:00,240
You see every time you define a flex container that will also define the flow direction of the elements
13
00:01:00,390 --> 00:01:02,840
inside of that flex container.
14
00:01:02,940 --> 00:01:08,850
Whether this direction is horizontally or vertically there are two flow directions.
15
00:01:08,850 --> 00:01:17,210
One row which is applied as a default when you define the flex container and basically aligns items
16
00:01:17,210 --> 00:01:24,950
horizontally like in the last video and two column which you have to apply if you want to override the
17
00:01:24,950 --> 00:01:28,790
default and columns align items vertically.
18
00:01:28,790 --> 00:01:34,490
But how do I change the flow direction of the elements from row to column.
19
00:01:34,730 --> 00:01:42,320
Well you use a property called Flex flow and apply it to the flex container itself and set its value
20
00:01:42,410 --> 00:01:43,550
to column.
21
00:01:43,550 --> 00:01:47,520
So let's actually do that and see what it looks like here.
22
00:01:47,540 --> 00:01:57,420
And my code editor and our CSSA file let's say flex flow column you can see now they're just sitting
23
00:01:57,420 --> 00:02:00,350
above each other like before.
24
00:02:00,440 --> 00:02:04,880
Now what is the point of all that and why did I say all those things.
25
00:02:04,880 --> 00:02:07,170
This is the most important lesson.
26
00:02:07,250 --> 00:02:15,830
Well the reason is because when the flex flow is set to row which again is the default then two imaginary
27
00:02:15,830 --> 00:02:18,740
axes are automatically generated.
28
00:02:18,770 --> 00:02:27,420
The main axis and the cross axis the main axis will be horizontal and the cross axis will be vertical.
29
00:02:27,560 --> 00:02:35,660
But if we set the flex flow to column then the main axis in this case will be vertical and the cross
30
00:02:35,660 --> 00:02:40,520
axis will be horizontal but still what's the big deal.
31
00:02:40,520 --> 00:02:42,020
Why is that so important.
32
00:02:42,230 --> 00:02:49,010
Well this is so important because later in the course when we use flex box properties some of them will
33
00:02:49,010 --> 00:02:54,830
always affect elements along the main axis depending on whether it's horizontal or vertical.
34
00:02:54,830 --> 00:03:01,690
Remember we said it will be horizontal if flex flow is Roe and it will be vertical flex flow column
35
00:03:02,120 --> 00:03:08,060
and some other properties will always affect elements along the cross axis depending on whether it's
36
00:03:08,060 --> 00:03:10,360
horizontal or vertical.
37
00:03:10,370 --> 00:03:17,060
By understanding this when you learn new properties you'll only need to know what access that property
38
00:03:17,060 --> 00:03:23,130
affects if it's the main access or assets to cross access and you're good to go.
39
00:03:23,190 --> 00:03:28,860
Let me help you understand better let's set flex flow to grow again.
40
00:03:29,120 --> 00:03:37,470
Now imagine that there are two axes going on the main axis and the cross axis the main axis.
41
00:03:37,490 --> 00:03:44,450
In this case we'll be horizontal because the flex flow is Roe and the cross axis will be vertical of
42
00:03:44,450 --> 00:03:45,180
course.
43
00:03:45,320 --> 00:03:53,940
Now I'm going to set justify content to space between Don't worry about this property right now.
44
00:03:53,940 --> 00:03:55,420
We will explore it later.
45
00:03:55,650 --> 00:04:01,440
But what I want you to know about this property is that it's considered a main access property.
46
00:04:01,440 --> 00:04:07,430
In other words it effects only the main axes which in our case is the horizontal.
47
00:04:07,560 --> 00:04:14,820
So if I go to my browser and refresh you can see that it affects the elements horizontally because the
48
00:04:14,820 --> 00:04:19,080
main axis is horizontal and it's a main axis property.
49
00:04:19,080 --> 00:04:28,060
But if I go to my C says and change flex floats a column and refresh Oh look the elements change vertically
50
00:04:28,560 --> 00:04:37,050
and yes that is because when the flex flow is call them the main axis is vertical and justify content
51
00:04:37,170 --> 00:04:39,430
affects the main axis.
52
00:04:39,450 --> 00:04:42,150
Now I hope you understood this lecture.
53
00:04:42,150 --> 00:04:48,390
I might have talked a lot and repeated a few things but that's because this lecture is very important
54
00:04:48,900 --> 00:04:51,770
and it will help you understand the entire course.
55
00:04:51,810 --> 00:04:55,870
So this is it for this lecture and I'll see you in the next one.
5867
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.