All language subtitles for 143 Browser Support and Fixing Flexbox Gap in Safari.en_US

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:01,390 --> 00:00:03,100 So with the latest effects 2 00:00:03,100 --> 00:00:06,020 that we just implemented using JavaScript, 3 00:00:06,020 --> 00:00:09,130 we can now basically consider that the design 4 00:00:09,130 --> 00:00:13,470 and planning step of our project is finished. 5 00:00:13,470 --> 00:00:16,390 So what that means is that now we're ready 6 00:00:16,390 --> 00:00:18,920 to move on to the next step. 7 00:00:18,920 --> 00:00:23,200 And that next step is the test and optimize phase, 8 00:00:23,200 --> 00:00:26,260 which remember includes these points here. 9 00:00:26,260 --> 00:00:29,360 So just like we talked about before 10 00:00:29,360 --> 00:00:32,670 at the beginning of our Omnifood project. 11 00:00:32,670 --> 00:00:35,000 And so over the next few lectures, 12 00:00:35,000 --> 00:00:38,020 we are going to talk about some of these points here 13 00:00:38,020 --> 00:00:39,920 and starting in this one, 14 00:00:39,920 --> 00:00:42,610 we will talk about browser support. 15 00:00:42,610 --> 00:00:46,490 Now browser support used to be a hugely important topic 16 00:00:46,490 --> 00:00:50,860 some years ago, but fortunately not so much anymore, 17 00:00:50,860 --> 00:00:54,960 but still I think that it's worth taking a couple of minutes 18 00:00:54,960 --> 00:00:57,373 to talk about browser support now. 19 00:00:59,070 --> 00:01:01,190 And when I say browser support, 20 00:01:01,190 --> 00:01:04,410 what I mean is basically how different web browsers 21 00:01:04,410 --> 00:01:07,620 support different CSS properties. 22 00:01:07,620 --> 00:01:11,090 So back in the day, like some 10 years ago, 23 00:01:11,090 --> 00:01:15,580 there used to be a ton of inconsistencies between browsers. 24 00:01:15,580 --> 00:01:18,720 So our websites would look completely different 25 00:01:18,720 --> 00:01:20,367 in different browsers. 26 00:01:20,367 --> 00:01:22,930 And that was simply because some browsers 27 00:01:22,930 --> 00:01:26,150 didn't implement some of the modern properties 28 00:01:26,150 --> 00:01:27,723 that we were using at the time. 29 00:01:28,570 --> 00:01:31,280 Now those days are fortunately over 30 00:01:31,280 --> 00:01:34,550 at least for the most important CSS properties 31 00:01:34,550 --> 00:01:37,000 and if we consider that our users 32 00:01:37,000 --> 00:01:40,980 are usually using the latest browser versions. 33 00:01:40,980 --> 00:01:44,140 However, there will, of course, always be some users 34 00:01:44,140 --> 00:01:48,050 that are left behind using some very old browsers, 35 00:01:48,050 --> 00:01:50,340 like some old Internet Explorer 36 00:01:50,340 --> 00:01:53,570 or are stuck on some older Safari version. 37 00:01:53,570 --> 00:01:55,550 And so there are some of the things 38 00:01:55,550 --> 00:01:59,503 that we use on our website might not work as we intend. 39 00:02:00,350 --> 00:02:02,830 So to help us developers with that, 40 00:02:02,830 --> 00:02:05,160 there is a very, very handy tool 41 00:02:05,160 --> 00:02:07,650 that we can use to basically see 42 00:02:07,650 --> 00:02:09,810 how different CSS properties 43 00:02:09,810 --> 00:02:12,033 are supported by different browsers. 44 00:02:13,010 --> 00:02:16,667 So let's check that out and it is called caniuse.com. 45 00:02:21,030 --> 00:02:23,830 And so here we can input any CSS property 46 00:02:23,830 --> 00:02:26,460 that we want and let's try, for example, 47 00:02:26,460 --> 00:02:29,320 one of the more modern things that we are using, 48 00:02:29,320 --> 00:02:30,863 which is CSS grid. 49 00:02:32,530 --> 00:02:35,950 So let's try to see what the browser support is like 50 00:02:35,950 --> 00:02:39,310 for CSS grid, and well, we can see 51 00:02:39,310 --> 00:02:41,350 that all the modern browsers 52 00:02:41,350 --> 00:02:43,620 basically support it, of course. 53 00:02:43,620 --> 00:02:48,620 So Microsoft Edge, Firefox all the way back to version 52, 54 00:02:49,970 --> 00:02:54,970 which was released all the way in 2017, you can see there. 55 00:02:55,020 --> 00:02:57,730 However, if some user still uses 56 00:02:57,730 --> 00:02:59,800 one of these old versions here, 57 00:02:59,800 --> 00:03:04,290 then they will not be able to basically see our layout. 58 00:03:04,290 --> 00:03:06,370 However, if one of our users 59 00:03:06,370 --> 00:03:09,930 is using this very old Firefox version here, 60 00:03:09,930 --> 00:03:11,870 then they will basically not be able 61 00:03:11,870 --> 00:03:15,670 to see anything that we did with CSS grid. 62 00:03:15,670 --> 00:03:19,840 And so our layout will basically be non-existent to them 63 00:03:19,840 --> 00:03:23,420 because we built our entire layout with CSS grid 64 00:03:23,420 --> 00:03:25,210 and if that doesn't exist, 65 00:03:25,210 --> 00:03:28,290 then all our elements will basically just appear 66 00:03:28,290 --> 00:03:29,623 one after another. 67 00:03:31,040 --> 00:03:34,490 Here, we also have this older Microsoft Edge version, 68 00:03:34,490 --> 00:03:36,880 which was also released way back 69 00:03:36,880 --> 00:03:40,800 and of course the even older Internet Explorers. 70 00:03:40,800 --> 00:03:42,650 So the Internet Explorers, 71 00:03:42,650 --> 00:03:46,550 they were always very big problems for web designers 72 00:03:46,550 --> 00:03:48,410 and web developers. 73 00:03:48,410 --> 00:03:51,720 So supporting them used to be really a nightmare 74 00:03:51,720 --> 00:03:55,423 and so we can be really glad that those days are over. 75 00:03:56,900 --> 00:03:59,470 So right now, basically the main browsers 76 00:03:59,470 --> 00:04:02,210 that matter to us are Microsoft Edge, 77 00:04:02,210 --> 00:04:05,340 Firefox, Chrome and Safari. 78 00:04:05,340 --> 00:04:07,690 And so if all the properties that we use 79 00:04:07,690 --> 00:04:10,010 are supported in these four browsers, 80 00:04:10,010 --> 00:04:13,460 then everything is fine and they should also be supported 81 00:04:13,460 --> 00:04:15,630 on their mobile versions. 82 00:04:15,630 --> 00:04:19,600 So Safari on iOS supports basically the same thing 83 00:04:19,600 --> 00:04:21,237 as the regular Safari 84 00:04:21,237 --> 00:04:24,683 and the same thing with Chrome for Android here. 85 00:04:26,070 --> 00:04:29,670 So this mobile browsers are also important to keep in mind 86 00:04:29,670 --> 00:04:32,100 as more and more of the internet traffic 87 00:04:32,100 --> 00:04:33,563 is shifting to mobile. 88 00:04:35,980 --> 00:04:37,400 And so up here, 89 00:04:37,400 --> 00:04:39,950 we can see basically that CSS grid 90 00:04:39,950 --> 00:04:44,540 is supported for around 95% of all users. 91 00:04:44,540 --> 00:04:46,180 And so that's quite good. 92 00:04:46,180 --> 00:04:49,610 And so therefore that's why we can right now 93 00:04:49,610 --> 00:04:53,160 choose to use CSS grid without any problem. 94 00:04:53,160 --> 00:04:57,180 And the same is true for Flexbox. 95 00:04:57,180 --> 00:05:01,750 So here it has even better support at a 98% 96 00:05:01,750 --> 00:05:03,980 and if we added prefixing, 97 00:05:03,980 --> 00:05:07,890 then that would increase to almost 100%. 98 00:05:07,890 --> 00:05:11,005 Now we didn't talk yet about what prefixing is. 99 00:05:11,005 --> 00:05:15,323 And so to talk about that, let me show you another example. 100 00:05:16,620 --> 00:05:19,873 So this is a CSS property that we haven't used yet. 101 00:05:21,920 --> 00:05:24,410 So back drop filter, 102 00:05:24,410 --> 00:05:26,320 and this is quite a modern one 103 00:05:26,320 --> 00:05:27,820 where you see that, for example, 104 00:05:27,820 --> 00:05:30,973 Firefox is not even supporting it at all. 105 00:05:33,030 --> 00:05:35,840 Now, Chrome supports it without any problem 106 00:05:35,840 --> 00:05:38,670 but then here you have this note here 107 00:05:38,670 --> 00:05:42,590 and what that note, so this yellow thing here, means, 108 00:05:42,590 --> 00:05:46,120 is that this property is only supported in Safari 109 00:05:46,120 --> 00:05:48,930 with the WebKit prefix. 110 00:05:48,930 --> 00:05:51,130 So let's actually try that out. 111 00:05:51,130 --> 00:05:53,883 So using this backdrop filter property, 112 00:05:56,090 --> 00:06:00,480 so let's go back here and in our queries, 113 00:06:00,480 --> 00:06:03,973 let's go to our main nav here. 114 00:06:08,690 --> 00:06:10,840 So, we'll just use the property here 115 00:06:10,840 --> 00:06:13,173 and I will then explain what it does. 116 00:06:14,800 --> 00:06:16,790 So backdrop filter, 117 00:06:16,790 --> 00:06:19,320 and then I'm going to use a blur 118 00:06:19,320 --> 00:06:21,493 and let's say 10 pixels. 119 00:06:24,060 --> 00:06:26,310 So now here on our page, 120 00:06:26,310 --> 00:06:31,310 let's open this up and open navigation. 121 00:06:31,790 --> 00:06:33,993 While now we cannot really see anything. 122 00:06:35,660 --> 00:06:40,533 So let's actually make this here a bit darker. 123 00:06:42,850 --> 00:06:47,313 So a little bit less transparent and maybe even more so, 124 00:06:48,650 --> 00:06:51,430 let's make it just 50% transparent 125 00:06:51,430 --> 00:06:54,300 and so let's turn that off and on again. 126 00:06:54,300 --> 00:06:56,580 And so you'll see now that basically, 127 00:06:56,580 --> 00:06:59,973 the content that is behind this element is blurred. 128 00:07:03,270 --> 00:07:04,533 So let's inspect that. 129 00:07:08,030 --> 00:07:13,030 So where is that, right here? 130 00:07:13,090 --> 00:07:15,583 So if I turn this off, then see what happens. 131 00:07:17,040 --> 00:07:18,180 So you saw that? 132 00:07:18,180 --> 00:07:20,900 Now it's no longer blurred, but this, 133 00:07:20,900 --> 00:07:24,520 it is very nicely blurred and this is a very modern 134 00:07:24,520 --> 00:07:26,710 and really, really cool effect 135 00:07:26,710 --> 00:07:30,240 that we can now create just using CSS. 136 00:07:30,240 --> 00:07:33,830 So again, the backdrop filter basically simply blurs 137 00:07:33,830 --> 00:07:36,713 everything that is behind that element. 138 00:07:38,380 --> 00:07:41,913 Alright, here let's maybe adjust this a little bit more, 139 00:07:42,760 --> 00:07:44,410 maybe like this, 140 00:07:44,410 --> 00:07:48,770 and actually I will leave it here at 60% 141 00:07:48,770 --> 00:07:50,470 and I will leave this one here on. 142 00:07:51,900 --> 00:07:55,903 All right, but now watch what happens in Safari. 143 00:07:57,530 --> 00:08:00,043 So just to make sure I'm gonna reload it here. 144 00:08:02,740 --> 00:08:05,420 All right, and as I open it, 145 00:08:05,420 --> 00:08:08,043 now you see that it is actually not blurred. 146 00:08:09,485 --> 00:08:12,750 So a different behavior, than in Google Chrome. 147 00:08:12,750 --> 00:08:14,250 And so that makes sense 148 00:08:14,250 --> 00:08:16,350 because here we have this information 149 00:08:16,350 --> 00:08:21,100 that it is only supported with that WebKit prefix. 150 00:08:21,100 --> 00:08:25,080 So let's use that prefix in practice 151 00:08:25,080 --> 00:08:26,980 and so basically what we need to do 152 00:08:26,980 --> 00:08:28,973 is to duplicate this line here. 153 00:08:30,080 --> 00:08:32,120 And then in the first occurrence, 154 00:08:32,120 --> 00:08:37,120 we can say -WebKit-backdrop filter. 155 00:08:38,320 --> 00:08:41,950 So adding this -WebKit- then their prefix. 156 00:08:41,950 --> 00:08:44,373 And so if we tried it out again, 157 00:08:45,570 --> 00:08:47,853 then you see it does work finally. 158 00:08:54,474 --> 00:08:56,960 But also let's test it in Firefox 159 00:08:56,960 --> 00:08:59,090 where it should not be working. 160 00:08:59,090 --> 00:09:00,640 So here we see that indeed 161 00:09:00,640 --> 00:09:04,340 it is not supported in any version right now. 162 00:09:04,340 --> 00:09:05,920 So let me open up Firefox 163 00:09:07,230 --> 00:09:12,230 and let's then copy paste that here. 164 00:09:16,500 --> 00:09:21,050 Okay, let's make it smaller and let's see. 165 00:09:21,050 --> 00:09:23,360 And yeah, just as expected, 166 00:09:23,360 --> 00:09:25,650 the background is not being blurred. 167 00:09:25,650 --> 00:09:28,120 And so what this means is that right now, 168 00:09:28,120 --> 00:09:31,100 if we have a user that is visiting our page, 169 00:09:31,100 --> 00:09:34,260 using Firefox, they will not really be able 170 00:09:34,260 --> 00:09:36,843 to see our navigation links here. 171 00:09:39,160 --> 00:09:42,340 And there's actually nothing we can do about that. 172 00:09:42,340 --> 00:09:44,640 So the only thing that we can do 173 00:09:44,640 --> 00:09:47,240 instead of being able to fix that blur 174 00:09:47,240 --> 00:09:50,320 is to simply put the background color here, 175 00:09:50,320 --> 00:09:53,623 back to being a little bit less transparent. 176 00:09:54,930 --> 00:09:59,930 So let's try with 80% and while that's still not so nice. 177 00:10:03,980 --> 00:10:06,840 And so here we are really trying to adapt our design 178 00:10:06,840 --> 00:10:09,460 to all different browsers now. 179 00:10:09,460 --> 00:10:12,053 So this is what browser support is all about. 180 00:10:13,270 --> 00:10:16,163 So here it does look maybe acceptable now, 181 00:10:17,010 --> 00:10:20,130 but here that blurring effect has almost been gone now 182 00:10:20,130 --> 00:10:23,530 because there is almost no transparency, 183 00:10:23,530 --> 00:10:26,800 but well, it is important that our Firefox users 184 00:10:26,800 --> 00:10:28,720 can also use the page 185 00:10:28,720 --> 00:10:30,893 and so I'm gonna leave it like this. 186 00:10:31,920 --> 00:10:35,593 Maybe it would fix it if we reduced the blur a little bit. 187 00:10:37,710 --> 00:10:41,023 So basically zero pixels means there is no blur at all. 188 00:10:42,740 --> 00:10:45,503 And yeah, maybe we can just use less blur. 189 00:10:46,450 --> 00:10:50,703 So maybe, yeah, I think I like these five pixels. 190 00:10:55,910 --> 00:10:57,670 And so, yeah, 191 00:10:57,670 --> 00:11:01,830 this is the prefix here that we use for Safari 192 00:11:01,830 --> 00:11:03,260 and for Google Chrome, 193 00:11:03,260 --> 00:11:06,373 but there are other prefixes for other browsers. 194 00:11:08,590 --> 00:11:12,773 For example, for the appearance, 195 00:11:13,700 --> 00:11:16,100 yeah, so for the appearance property, 196 00:11:16,100 --> 00:11:19,433 which basically allows us to easily style form elements, 197 00:11:20,550 --> 00:11:23,400 we might use this vendor prefix here 198 00:11:23,400 --> 00:11:27,410 of moz or moz or whatever (laughs). 199 00:11:27,410 --> 00:11:30,863 So this one is the one for Mozilla Firefox. 200 00:11:32,100 --> 00:11:37,100 For Edge now it's also WebKit because they use WebKit now, 201 00:11:37,610 --> 00:11:41,310 but for Microsoft Edge and for Internet Explorer, 202 00:11:41,310 --> 00:11:42,457 it used to be -MS-. 203 00:11:45,463 --> 00:11:49,323 You also have Opera where it is, oh, it's also WebKit. 204 00:11:50,820 --> 00:11:54,740 So now it's WebKit but it used to be just -O- 205 00:11:54,740 --> 00:11:57,830 and so if you see those vendor prefixes out there 206 00:11:57,830 --> 00:12:00,160 in some other codes that you analyze, 207 00:12:00,160 --> 00:12:01,923 then now you know what they mean. 208 00:12:02,860 --> 00:12:05,410 All right, so we learned a little bit 209 00:12:05,410 --> 00:12:07,260 what browser support is. 210 00:12:07,260 --> 00:12:11,100 We also learned how we can use this very important tool here 211 00:12:11,100 --> 00:12:14,193 to check how well a certain CSS property 212 00:12:14,193 --> 00:12:18,500 that we might want to use is supported across all browsers. 213 00:12:18,500 --> 00:12:21,660 And we also learnt how to use vendor prefixes 214 00:12:21,660 --> 00:12:25,610 to basically make a CSS property work 215 00:12:25,610 --> 00:12:27,560 across multiple browsers. 216 00:12:27,560 --> 00:12:32,560 And in this case it was the backdrop filter property. 217 00:12:35,660 --> 00:12:38,163 However, there is still something very important 218 00:12:38,163 --> 00:12:39,660 that we need to do, 219 00:12:39,660 --> 00:12:43,040 which is to fix the gap property in Flexbox 220 00:12:43,040 --> 00:12:44,943 for the Safari browsers. 221 00:12:45,800 --> 00:12:50,400 So up until very recently at the beginning of 2021, 222 00:12:50,400 --> 00:12:52,727 Safari did not support the usage 223 00:12:52,727 --> 00:12:57,727 of the get property in Flexbox only in CSS grid, 224 00:12:57,840 --> 00:13:02,150 but we did use gap all the time using Flexbox. 225 00:13:02,150 --> 00:13:05,720 And so if there is some like Safari browser, 226 00:13:05,720 --> 00:13:08,750 especially on an older iPhone, 227 00:13:08,750 --> 00:13:13,434 they will not be able to see our layout as expected. 228 00:13:13,434 --> 00:13:15,950 So Flexbox will not really work for them, 229 00:13:15,950 --> 00:13:19,060 or at least all the spacing will be gone. 230 00:13:19,060 --> 00:13:21,600 So the page is gonna look terrible for them 231 00:13:21,600 --> 00:13:24,730 and so we should definitely fix that. 232 00:13:24,730 --> 00:13:28,330 So I already included some code for that here 233 00:13:28,330 --> 00:13:31,190 in this JavaScript file. 234 00:13:31,190 --> 00:13:35,250 And so for that, we have basically this function here. 235 00:13:35,250 --> 00:13:39,120 So this is kind of a hack that I found online 236 00:13:39,120 --> 00:13:41,170 and I'm not really gonna go into it. 237 00:13:41,170 --> 00:13:44,480 But what it does is that if a certain browser 238 00:13:44,480 --> 00:13:47,990 does not support the gap property for Flexbox, 239 00:13:47,990 --> 00:13:51,043 it will add this class here to the body. 240 00:13:52,550 --> 00:13:54,190 And so I advise you, 241 00:13:54,190 --> 00:13:56,520 for at least in the next couple of years, 242 00:13:56,520 --> 00:14:00,550 to always include this function here in your code, 243 00:14:00,550 --> 00:14:04,140 which again, will add this property here to your body 244 00:14:04,140 --> 00:14:06,240 in case that any of the browsers 245 00:14:06,240 --> 00:14:11,240 that any of your user is using does not support Flexbox gap. 246 00:14:11,420 --> 00:14:14,260 And so then you can use this property here 247 00:14:14,260 --> 00:14:18,810 to basically add those gap back with margins. 248 00:14:18,810 --> 00:14:21,930 And so that's the code that they have down here. 249 00:14:21,930 --> 00:14:24,130 So let me copy all of this here. 250 00:14:24,130 --> 00:14:27,000 So everything that is in this comment, 251 00:14:27,000 --> 00:14:30,973 because this is not JavaScript code, it is actually CSS. 252 00:14:31,960 --> 00:14:33,980 So I'm copying it now 253 00:14:33,980 --> 00:14:37,293 and I will put it here at the end of the queries. 254 00:14:42,440 --> 00:14:47,440 Pasting that there, let me also get some comment block here. 255 00:14:56,450 --> 00:15:00,383 So fixing Safari Flexbox gap, 256 00:15:03,260 --> 00:15:05,950 so basically what I did here was to write 257 00:15:05,950 --> 00:15:07,410 this entire code here, 258 00:15:07,410 --> 00:15:10,240 for every instance where we use to get property 259 00:15:10,240 --> 00:15:12,840 together with Flexbox so that now, 260 00:15:12,840 --> 00:15:14,610 we don't have to waste any time 261 00:15:14,610 --> 00:15:16,903 writing all of this code here ourselves. 262 00:15:18,480 --> 00:15:21,640 So let me just quickly go through one or two examples, 263 00:15:21,640 --> 00:15:24,283 just so you see how you could do it on your own. 264 00:15:25,690 --> 00:15:29,303 So this one here is in the main nav list. 265 00:15:30,730 --> 00:15:32,703 So let's move that here actually. 266 00:15:35,716 --> 00:15:40,716 So here we have a gap of 4.8 rem on the flex container 267 00:15:42,860 --> 00:15:44,880 and so basically what that means 268 00:15:44,880 --> 00:15:48,603 is that we want a margin right on all the flex items. 269 00:15:49,500 --> 00:15:52,540 So the flex items of the main nav list 270 00:15:52,540 --> 00:15:55,383 are of course, the li elements. 271 00:15:56,720 --> 00:15:59,453 So just so you can see it. 272 00:16:02,410 --> 00:16:05,733 So that's here in the header that we closed. 273 00:16:07,160 --> 00:16:10,560 So main nav list and the direct children, 274 00:16:10,560 --> 00:16:13,220 so the flex items are these ones here. 275 00:16:14,350 --> 00:16:18,730 And so that's where we now at the margin right of 4.8 rem 276 00:16:18,730 --> 00:16:20,933 when the gap is not supported. 277 00:16:23,840 --> 00:16:27,040 And we want to add that, of course not on all of them. 278 00:16:27,040 --> 00:16:30,710 And so here, I'm using that trick that I showed you earlier. 279 00:16:30,710 --> 00:16:33,490 So basically applying this style on all elements, 280 00:16:33,490 --> 00:16:35,713 but not on the last child. 281 00:16:37,670 --> 00:16:40,810 But of course, we only want this style here to apply 282 00:16:40,810 --> 00:16:45,750 when the no Flexbox gap class is present in the body. 283 00:16:45,750 --> 00:16:50,600 So basically being a parent element of this main nav list. 284 00:16:50,600 --> 00:16:54,920 And so again, this class here is coming from JavaScript. 285 00:16:54,920 --> 00:16:58,250 So right here in case that Flexbox 286 00:16:58,250 --> 00:17:00,533 does not support the gap property. 287 00:17:03,600 --> 00:17:07,350 So unfortunately I cannot show you this in practice 288 00:17:07,350 --> 00:17:11,320 because my Safari here does now already support gap, 289 00:17:11,320 --> 00:17:16,280 but up until like one month ago, it didn't work. 290 00:17:16,280 --> 00:17:20,630 So this is how we do it here for the default Flexbox, 291 00:17:20,630 --> 00:17:23,080 let's say, so margin right 292 00:17:23,080 --> 00:17:25,740 when we are using Flexbox horizontally, 293 00:17:25,740 --> 00:17:27,210 but sometimes remember, 294 00:17:27,210 --> 00:17:29,760 we change the flex direction to column. 295 00:17:29,760 --> 00:17:33,670 And so in those situations we use margin bottom, 296 00:17:33,670 --> 00:17:35,510 just like, for example, in the list, 297 00:17:35,510 --> 00:17:38,043 which we made vertical. 298 00:17:40,526 --> 00:17:42,893 So let's see that here just very quickly. 299 00:17:43,790 --> 00:17:48,790 So some were down here and indeed here is the list 300 00:17:48,900 --> 00:17:53,080 where have a gap of 1.6 and flex direction column. 301 00:17:53,080 --> 00:17:56,330 And so the child elements here are the list item 302 00:17:56,330 --> 00:17:58,530 and so there we are now adding those 1.6 rem 303 00:18:00,153 --> 00:18:03,490 as a margin to the bottom on all of them, 304 00:18:03,490 --> 00:18:05,393 except again, the last child. 305 00:18:07,230 --> 00:18:10,520 Then I also needed to do that in the media queries 306 00:18:10,520 --> 00:18:11,950 in some situations. 307 00:18:11,950 --> 00:18:15,820 And so here, I got these two exact same media queries 308 00:18:15,820 --> 00:18:19,300 that we also have already in the top there. 309 00:18:19,300 --> 00:18:20,270 And by the way, 310 00:18:20,270 --> 00:18:22,750 writing the same media query twice, 311 00:18:22,750 --> 00:18:26,810 basically, is absolutely no problem at all. 312 00:18:26,810 --> 00:18:30,160 So that's actually something that we do all the time, 313 00:18:30,160 --> 00:18:33,460 while in this project, we actually didn't do it, 314 00:18:33,460 --> 00:18:36,100 but that is completely possible as well. 315 00:18:36,100 --> 00:18:39,063 So simply both of them will apply at the same time. 316 00:18:41,610 --> 00:18:43,090 And so, yeah, 317 00:18:43,090 --> 00:18:46,530 I think that's all I had to tell you about browser support. 318 00:18:46,530 --> 00:18:49,480 So make sure to understand this part here 319 00:18:49,480 --> 00:18:51,150 and to do the similar thing 320 00:18:51,150 --> 00:18:55,610 if you want to use the gap property together with Flexbox 321 00:18:55,610 --> 00:18:58,640 at least for the next couple of years, at least. 322 00:18:58,640 --> 00:19:02,020 So maybe in 2024 or 25, 323 00:19:02,020 --> 00:19:04,543 they're no longer gonna be necessary. 24414

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.