How to take control of Flexbox

  Рет қаралды 145,164

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 114
@ryan.wakefield
@ryan.wakefield 8 ай бұрын
One thing you said here I had never thought about was the fact that flexbox is controlled inside-->out, but grid is controlled outside-->in. That makes a lot of sense and actually clarifies a lot more of this. Thanks for all of the amazing videos!
@Allformyequine
@Allformyequine 8 ай бұрын
I noticed that too, that's a great easy concept to keep in mind! Super!
@chrisstromberg6527
@chrisstromberg6527 3 ай бұрын
This is really key to understanding the fundamentals of flexbox and what it is trying to do. Definitely helps me to better understand this.
@yenngocphan766
@yenngocphan766 Ай бұрын
This is my favorite flexbox video, because it uses a real life scenario. Keep up the good work.
@jacopo710
@jacopo710 6 ай бұрын
Excellent explanation! Flexbox is inside -> out, grid is outside -> in!
@kerrykreiter445
@kerrykreiter445 9 ай бұрын
Thank you Kevin! “Content is king in flexbox” is going to stick with me. This video really helped me get a much better understanding of flex shrink and grow and how they can be used in many layouts. Thank you for developing and sharing such useful content!
@jfftck
@jfftck 9 ай бұрын
I think the issue with people understanding flexbox is due to them not working with HTML tables, because, if they had, they’d see how both use a similar - if not the same - resizing behavior. Every time I use flexbox, I think of them as defaulting to being like a table row - where it can only have one row - and, just like tables, you have to define the behavior you want. This proves that the algorithm for tables were a good solution for layout, but breaking it up into two layout properties (flexbox and grid) gave us much more control over that algorithm. This is what CSS is about, I think all the interactive parts of CSS could be turned into a new language and that might make that simpler. It’s as though things like animations, transitions, and transforms are all complex due to having to fit into the CSS design specifications. I understand these very well, but find the syntax is the most complex part of it, since CSS was designed for layout and styling.
@magoxxii
@magoxxii 9 ай бұрын
Every time I have an issue to solve, you upload a video related! its so great! thanks for such amazing content always!
@StephenRayner
@StephenRayner 8 ай бұрын
Same, finally digging deep into CSS as sick of being crap at it. 15 years experience, AWS, python, typescript, C#, React, React Native blah blah… But CSS every time I am just fighting it. Need to really learn more beyond box model, cascading, inheritance.
@mendosis
@mendosis 9 ай бұрын
i wouldn't bother guessing or forcing the size of the middle part you should align images to avoid inconsistencies (which in my opinion is the best place to set flex-shrink to 0) and send metaboxes to the right-hand side (either with automargin or with flex-grow in the middle). then you can let the latter two play or fix the size of the metabox if your design is grid based
@yatskanych_oleksandr
@yatskanych_oleksandr 9 ай бұрын
That's why i prefer to use grid instead of flex. Thanks for useful content as usually
@نورالدينعمادتوفيق
@نورالدينعمادتوفيق 2 ай бұрын
the thing I always say is Flex is all about justice. it gives each item as much width as it needs ( that's the default behavior we change with grow, shrink, and basis). when we set an item with a fixed basis and flex-shrink of a 1, as soon as that item starts shrinking from its basis then every other item shall start shrinking at the same rate ( that's why we can set different shrink ratings). again the same thing applies to flex-grow, if two items are allowed to grow then as soon one item starts growing, the other also starts also growing. in this way flex achieves "justice" by making all items grow and shrink at the same time and rate as soon as one item starts growing or shrinking from its original basis.
@m.smanoj4688
@m.smanoj4688 3 ай бұрын
Anyone who is starting to learn web development, especially CSS, and responsive page design should learn CSS BASICS properly-master the basics. You should be able to visualize a design in your mind, even if someone asks you about it in a dream. And finally, try to watch almost all of Kevin Powell's videos without missing any. You will definitely never regret watching them. EAST OR WEST, KEVIN POWELL IS THE BEST!
@chrisstromberg6527
@chrisstromberg6527 3 ай бұрын
A lot of us are coming here after learning the basics. The basics unfortunately don't explain the nuances of Flexbox and why it behaves as it does.
@m.smanoj4688
@m.smanoj4688 3 ай бұрын
@@chrisstromberg6527 as absolutely flexbox works inside out type contents of flexbox has effects on outside like told by Kevin
@reneeschke
@reneeschke 9 ай бұрын
Pleeease a Video explicitly exploring flex basis in column direction. Shrink and grow in column works conceptually so much different as you always (usually...) have room to scroll and therefore no limiting height
@satadhi
@satadhi 7 ай бұрын
Sir, i would like to confess that you are simply the best.
@MartinDoudoroffLLC
@MartinDoudoroffLLC 9 ай бұрын
Thanks!
@KevinPowell
@KevinPowell 9 ай бұрын
Thanks so much!
@LukeDorny
@LukeDorny 9 ай бұрын
Great overview. Thanks, Kevin.
@tutestheking7838
@tutestheking7838 9 ай бұрын
most of the time I use grid just because it just does what i want, but using flex-shrink/grow/basis seems like a good option in some cases. Thanks for the content Kevin
@chrisstucker1813
@chrisstucker1813 9 ай бұрын
Both are very useful. It made more sense to me the moment I realised flex sizes are determined by the children content whereas grid is more about the parent. That’s why grid feels more comfortable, because you’re not worrying so much about the children content. In grid, the children abide the parent; in flex, the children control the parent!
@ilyesPR
@ilyesPR 5 ай бұрын
So much pain healed thanks to this guy
@dongbinkim3773
@dongbinkim3773 9 ай бұрын
Feel like finally getting to Flexbox. Thank you!
@yogibarista2818
@yogibarista2818 9 ай бұрын
I tend to use flex-basis: to control the "fixed-size" elements
@vladpopescu2004
@vladpopescu2004 9 ай бұрын
Hello Kevin, your link for flexbox simplified has left the analytics parameters out. Thank you for the consistently good content!
@shekar_webdev
@shekar_webdev 9 ай бұрын
felt like reading css manual while watching the video thanking you sir!🙏🙏
@tomiekk6255
@tomiekk6255 9 ай бұрын
This is super interesting! Personally from what you showed I think I would use Flexbox over grid in such situation, are there any pros of using grid in this particular example?
@pedromenezes4013
@pedromenezes4013 9 ай бұрын
thanks! you're always helping demystify tricky behavior!
@m12652
@m12652 9 ай бұрын
Thanks... again 👍 Anyone else notice Chrome is not handling anchor positioning/popovers properly since a couple of updates back? Mine are always opening top left regardless of where the element they are anchored to is.
@Efibe8
@Efibe8 6 ай бұрын
Thank you for your video! Love it.. as a begginer its very helpful
@simon-off
@simon-off 9 ай бұрын
I'm gonna try to use flex some more when it's suitable. Grid is just so good though 😅 Great video! Thanks Kevin
@amanuelelhanan4716
@amanuelelhanan4716 9 ай бұрын
This statement opened my eyes Kevin, 4:20
@KeithTharp
@KeithTharp 9 ай бұрын
Excellent!! I've been avoiding flexbox for so long, this helps a ton
@pinnaclewd
@pinnaclewd 9 ай бұрын
Im sticking with grid.....its all I need.
@Julie-gh5ir
@Julie-gh5ir 9 ай бұрын
Is there the same kind of video, but with grids ? I avoid learning it for so long.... Kevin seems to be the good teacher for me.
@somrigostsaas
@somrigostsaas 9 ай бұрын
@@Julie-gh5ir not the same kind, since there's so much more to cover with grid, but just go to his channel and search for "grid" and you'll find tons of helpful material!
@RickBeacham
@RickBeacham 9 ай бұрын
You may need to learn Flex-box especially when many websites are using it instead of the wonderful GRID... :)
@Julie-gh5ir
@Julie-gh5ir 9 ай бұрын
I already know flexbox.@@RickBeacham
@StephenRayner
@StephenRayner 8 ай бұрын
I can’t recall why but there are some situations where flex is more suitable than grid.
@rayyanabdulwajid7681
@rayyanabdulwajid7681 9 ай бұрын
Guys, just remember how to use display flex, justify content center, align items center, flex wrap: wrap, flex shrink, justify content space between, flex 1 ,etc
@haidubogdan8712
@haidubogdan8712 9 ай бұрын
recently I needed to solve styling for columns with stacked blocks. The solution was not grid, and not display flex but column-count : nr. I'm interested if you can make a video about column-count, column-span .... css
@0xbinarylol
@0xbinarylol 7 ай бұрын
Before this video i was controlled by flexbox. Now I'm controlling flex box
@ekchills6948
@ekchills6948 5 ай бұрын
taking advantage of flex grow and shrink really made my layots mch better
@JimKernix
@JimKernix 8 ай бұрын
at 3:15 you clicked and dragged each image in the article.hotle-listing and a faded out version of the photos was visible until you released your mouse. What is that? How does the browser enable that? I know it's not related to your video but that is an interesting behavior...
@atwarwithlife
@atwarwithlife 8 ай бұрын
you're the css goat.
@rrenildopereiraa
@rrenildopereiraa 9 ай бұрын
amazing stuff! this will help my projects a lot!
@jesisadhikari
@jesisadhikari 8 ай бұрын
Really saved my time dude, thanks!
@Julie-gh5ir
@Julie-gh5ir 9 ай бұрын
What are the differences between flex-basis and width ? I always use width... But perhaps it is not the better solution ?
@scott-richardson
@scott-richardson 6 ай бұрын
I have always just assigned a percentage width on each of the flex items and then they shrink and grow nicely.
@Techgether
@Techgether 9 ай бұрын
when is the appropriate situation when we use width vs flex basis? i still cant grasp the concept of flex basis :/ do u have a video on this?
@Techgether
@Techgether 8 ай бұрын
@MrTicketeer understand the purpose of flex basis, but unclear how to use it..
@Techgether
@Techgether 8 ай бұрын
@MrTicketeer yes I understand the purpose of flex basis better now. How to use it is my 2nd question and I meant like I don't understand the syntax or what unit to use under flex basis
@ofadiman
@ofadiman 9 ай бұрын
Flexbox is taking control of my life 😳
@JoelGallant236
@JoelGallant236 9 ай бұрын
Why not space-between?
@jagonza2000
@jagonza2000 9 ай бұрын
love it! 👏
@percurious
@percurious 9 ай бұрын
Talking about flex laxouts - just stumbled upon a problem where someone was a bit to loose with things - can you think of any usecase where you would want a flex-direction: column; combined with a flex-wrap: wrap; ? 🤔
@abhim6380
@abhim6380 9 ай бұрын
Bought the course. Any plans to make grid simplified?
@GauravKumar-qe7iu
@GauravKumar-qe7iu 9 ай бұрын
did display: grid; and grid-template-columns: auto 1fr auto; works same in this case?
@jan.kowalski
@jan.kowalski 9 ай бұрын
Excellent explanation. Thanks!
@Lucifer-vz4hg
@Lucifer-vz4hg 9 ай бұрын
man is saving us
@ToyotaCharlie
@ToyotaCharlie 8 ай бұрын
this episode was very Canadian with all the "outs" ❤️🇨🇦😉
@proteus1
@proteus1 9 ай бұрын
Grid and Flex both have their advantages.If I was programming Grid, would make a rule for cloning rows. Grid row-d to copy parent. D for duplication of parent. No brainer to me. Why make life complicated.
@OCEMTechZone
@OCEMTechZone 9 ай бұрын
Great Sir 🎉
@quark2012
@quark2012 9 ай бұрын
How many times I fight with this problem :) Thanks
@vilijanac
@vilijanac 9 ай бұрын
It would be nice if would resize and flex different images to a max-with.
@djamaatul
@djamaatul 8 ай бұрын
im using flex-1 instead flex-grow-1, when use case use flex-1 vs flex-grow ?
@einatblackrose
@einatblackrose 9 ай бұрын
That's very helpful. Thank you
@MrJettann
@MrJettann 9 ай бұрын
If I need consistent layout, usually I'm using grid
@KevinPowell
@KevinPowell 9 ай бұрын
yeah, grid is probably an easier choice here, and where I'd have gone first, which I sort of alluded to druing the video, but sometimes it's nice to know how to wrangle flexbox a little.
@svnbeats6700
@svnbeats6700 6 ай бұрын
To be honest i use both 😂
@moritzdeiaco2798
@moritzdeiaco2798 9 ай бұрын
The og border lime hack! Nice video
@AtiqurRahman-gj6mg
@AtiqurRahman-gj6mg 7 ай бұрын
This is really helpful
@tayfun6378
@tayfun6378 5 ай бұрын
we are here to learn and all we see is your directions to your other videos and your course.
@RickBeacham
@RickBeacham 9 ай бұрын
Why did you stop using Firefox? :(
@xyster7
@xyster7 13 күн бұрын
the main issue with flexbox is working with someone else code not understanding idea of layout, it is just mental struggle when it comes to a simple things to make them easy reusable. It takes time and often it is not really worth.
@sumitsinha995
@sumitsinha995 9 ай бұрын
He Kevin there must be starter code .Like there is full code availble.
@Fad-kun
@Fad-kun 3 ай бұрын
Thanks
@sargaa8471
@sargaa8471 7 ай бұрын
what's happening with the webcam ?
@azizbaouchi
@azizbaouchi 7 ай бұрын
Which browser do you work on ?
@ClarkSell
@ClarkSell 9 ай бұрын
THAT HOODIE!!!
@vardhankulkarni6143
@vardhankulkarni6143 5 ай бұрын
GODDDDDDD !!!!!
@GerritforBazeja
@GerritforBazeja 9 ай бұрын
this is nice to know. Tnx
@sjd_style
@sjd_style 8 ай бұрын
Amazing tnx
@LokiDaFerret
@LokiDaFerret 9 ай бұрын
This video is a good example why you don't use flex. Grid is the right tool for the job. At least in this layout. However you missed a great opportunity to explain flex shrink and grow better. Because they are a ratio. If they are all set to one then your ratio is 1:1. If one of them is set to 2 then your ratio is 2:1 etc. In other words the speed at which something grows and shrinks relative to its siblings can be controlled. A missed opportunity 😂
@toptravelingoffers7666
@toptravelingoffers7666 9 ай бұрын
Why don't you add your videos in playlist. example this video. It also becomes very difficult to find specific videos within many videos so having a playlist or play store serial would be very helpful. I just started web dev[CSS] and I love your videos so I have a request for you to make a complete serial playlist for beginners. Your videos are amazing and the playlists are beautiful but I don't know which playlist to start with,, so please make a videos to guide beginners step by step serial playlists🙏
@KevinPowell
@KevinPowell 9 ай бұрын
Once you get past the very basics, which I have a playlist on, it can be hard to organize things after that because it often comes down to what you're trying to accomplish, but I'll see what I can do 😊
@safariknight3239
@safariknight3239 9 ай бұрын
I swear I only understand this because of Kevin
@gE0013
@gE0013 9 ай бұрын
With the introduction of "grid", I think "flex" is going to be used way less. Basically, if you have a pile of elements, you are probably going to use "grid" because you want to keep things aligned.
@DeadShotFPS
@DeadShotFPS 8 ай бұрын
Not at all. As Kevin says in this video and many others, Flexbox is most useful in cases where you want each item’s size to be determined by its content.
@gE0013
@gE0013 8 ай бұрын
@@DeadShotFPS I don't get your point: since is very common that piled elements have different content, if you use flex it would be harder to make them aligned. And the reason is exactly what you said.
@srinathsagar4736
@srinathsagar4736 9 ай бұрын
make a video on GRID
@RohitKumar-xs3wh
@RohitKumar-xs3wh 7 ай бұрын
nice
@OghamTheBold
@OghamTheBold 8 ай бұрын
Lack of understanding hints at hidden algorithm
@AlThePal78
@AlThePal78 8 ай бұрын
almost want to use tables lol
@SmileyJack.
@SmileyJack. 9 ай бұрын
10:14 E O_O -> --_--
@AJCastello
@AJCastello 6 ай бұрын
Let's go back to tables, seriously.
@planesrift
@planesrift 8 ай бұрын
Just do everything on canvas /s
@DeepakKumar-ob6ps
@DeepakKumar-ob6ps 9 ай бұрын
Same price without breakfast? 😂
@NoToBusinessCasual
@NoToBusinessCasual 8 ай бұрын
I hate Flexbox. Completely unreliable and undependable. Rubbish concept.
@chezchezchezchez
@chezchezchezchez 7 ай бұрын
Tell us what you love then.
@douglasjamesmartin
@douglasjamesmartin 5 ай бұрын
It's just garbage, unbelievable you guys have to work with this stuff
@udayabhaskar
@udayabhaskar 6 ай бұрын
Lot of bs in this video tbh, unlike other good ones in this channel.
@user-ouss
@user-ouss 8 ай бұрын
Please don't speak fast
@BeautifulTurkish
@BeautifulTurkish 8 ай бұрын
You can use 0.75 speed
@ТестТестович-г2о
@ТестТестович-г2о 9 ай бұрын
I don't use flexbox, because it feels like an old man trying to learn teenager's slang. Disgusting. Why it's not "grid" or something?
@amanrohilla4435
@amanrohilla4435 6 ай бұрын
Why are you using these thumbnails so frequently 👎
@Team-hf7iu
@Team-hf7iu 6 ай бұрын
You, ungrateful person. Why focusing on that? Can't you see he is doing his best to help us. And his thumbnails are very good and captivating according to me and to most people if not he won't have the number of views and good feedback he has. Stop that
@Pareshbpatel
@Pareshbpatel 8 ай бұрын
Nice one, Kevin. thanks. {2024-04-23}
Learn flexbox the easy way
34:04
Kevin Powell
Рет қаралды 731 М.
Avoid These 5 Awful CSS Mistakes
20:42
Kevin Powell
Рет қаралды 199 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
My top 5 most popular front-end tips
22:07
Kevin Powell
Рет қаралды 68 М.
We can now transition to and from display: none
21:20
Kevin Powell
Рет қаралды 112 М.
Each Media Query in CSS You MUST Know
4:47
IFace
Рет қаралды 4,3 М.
A new approach to container and wrapper classes
25:27
Kevin Powell
Рет қаралды 271 М.
CSS Popover + Anchor Positioning is Magical
20:44
Kevin Powell
Рет қаралды 49 М.
Finally Understanding The Usefulness Of CSS Subgrid: In Just 10 Minutes
10:56
Frontend FYI – by Jeroen
Рет қаралды 6 М.
Flexbox or grid - How to decide?
18:51
Kevin Powell
Рет қаралды 749 М.
23 CSS features you should know (and be using) by now
31:31
Kevin Powell
Рет қаралды 82 М.
Using CSS custom properties like this is a waste
16:12
Kevin Powell
Рет қаралды 183 М.
CSS Grid Alignment & Justification Without the Guesswork
13:17
Kevin Powell
Рет қаралды 18 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН